I am working on workflows.
I have diffrent types of steps in my workflow .
Step 3 Approve / Terminate
Step 5 - - Approve / Reject
Can any one help on these.
1.In Step 5, If user rejects workflow , i need start workflow from Step 2 and Ends current workflow.
i have seen workflowSession.Startworkflow() , but these are starting workflows from step 1.
i need start workflow from Step 2 or step3 ?
2. In Step 3 , when user terminate i need terminate workflow.
I was tried
public void execute(WorkItem item, WorkflowSession wfsession, ........)
Workflow workflow = item.getWorkflow();
I did not see workflow End ?
By seeing above example i can say most of the processing can be done through built in process components for example after step 5 you can use (And/OR) function component to Split the workflow instead handling through custom code. Same at step 3 the terminate process (Not sure about your requirement) as mentioned user terminate the process then the workflow manager will automatically take care of the next rout and what to do, you need require to do extra processing. Any how when you terminate it will come under "abort" category and you can see it under "archieve" tab at "http://<host>:<port>/libs/cq/workflow/content/console.html"
I would also suggest you to once go through http://dev.day.com/docs/en/cq/current/workflows/wf-ref.html and http://dev.day.com/content/kb/home/cq5/Development/CQ5WorkflowDev.html which will give you more insite information.