cancel
Showing results for 
Search instead for 
Did you mean: 

Execution of Asynchronous workflow

demouser
Champ in-the-making
Champ in-the-making
Execution of Asynchronous workflow with example: Workflow configured with serviceTask1, serviceTask2, serviceTask3, serviceTask4, serviceTask5

UseCase1:
If serviceTask3 have some exception then will have one entry in ACT_RU_JOB with EXCEPTION_MSG_ exception message and if we try to rexecute the workflow using managementService.executeJob(Id) it starts from serviceTask3.

UseCase2:
If serviceTask3 due to some exception wll have one entry in ACT_RU_JOB with EXCEPTION_MSG_ as empty and if we try to rexecute the workflow using managementService.executeJob(Id) its not starting form serviceTask3, Why again it starts form serviceTask1 ?

Is there any thing missing to throw the exception in a specified format.?
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Depens on how you configured the process: are all the service tasks asynchrounous?
If so, then you will always roll back to the last stable state, ie the previous service task.

If only the first one is async, you will always roll back to the first one.

demouser
Champ in-the-making
Champ in-the-making
All the servicetask conifgured as asynchronous.

frederikherema1
Star Contributor
Star Contributor
If all service-tasks are configured as asynchronous, each of them will be executed in their own job, each persisting the state to the database when the complete successfully. So the DB will contain a pointer to service task 3 after the failed execution of job. So the next time it executes, it will execute service task 3 again. There is no specific format for the exception to have in order to be picked up as a failed job. When an exception has no message, the EXCEPTION_MSG_ will be empty, but the reference to the stacktrace will be filled in.

Double-check if ALL service-tasks are marked as asynchronous. If this is the case, and you still get this behaviour, try ripping out all unneeded code and create a failing unit-test, demonstrating this problem. Then we can look at this asap… See the sticky in the forum for guide on creating a unit-test project.