cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid execution flow when User Task and Boundary Timer has same out node

jdp
Confirmed Champ
Confirmed Champ
Hi,

I have a workflow which has two user task U1 and U2, U1 has attached boundary timer BT with 1 minute time duration. U1 and BT both has out node ends to U2. Please refer attached process definition and workflow status screen here : https://www.dropbox.com/s/x85fgfyqqih5wa2/Activiti_BoundaryTimer.png?dl=0

Now when boundary timer BT executes from U1, workflow gets moved to U2 and executes U2. But here execution path shows that U1 is completed and U1 gets workflow moved to U2, which is wrong, actually boundary timer BT is executed and that’s way workflow has moved to U2.

Is this expected behavior, if yes, why ?


Thanks,
JDP
14 REPLIES 14

jdp
Confirmed Champ
Confirmed Champ
Hi,

I have tested the same scenario with exclusive gateway, execution path displayed still invalid : https://www.dropbox.com/s/4bxz9ruwprelk6a/Activiti_BoundaryTimer_ExGT.png?dl=0

but when I have added another exclusive gateway in between it displayed proper execution path : https://www.dropbox.com/s/hillzr03vfnzlyn/Activiti_BoundaryTimer_ExGT2.png?dl=0

So is this a Activiti framework's standards that out node should be different for boundary timer event ?

Please suggest.
JDP


martin_grofcik
Confirmed Champ
Confirmed Champ
Hi JDP,

How did you get execution path?
(Could you create jUnit test? https://forums.activiti.org/content/sticky-how-write-unit-test)

Regards
Martin

jdp
Confirmed Champ
Confirmed Champ
Hi Martin,

Thanks for the reply, actually I have observed this behavior in my application which has integrated activiti framework. So I have tested the same workflow in activti explorer which I had downloaded from activiti site itself, and found same behavior here as well, I am considering execution path which displayed with RED font. All the attached screenshots above are also of the same activiti explorer.

So, here activiti explorer is also displaying execution path in this way. however I am constructing the execution path from processDefinition.getActivities() and
List<HistoricActivityInstance> historicActivityInstances = ActivitiUtil.getHistoryService().createHistoricActivityInstanceQuery()
                .processInstanceId(processInstanceId).list();


You can check the same scenario in activiti explorer with simple workflow as I had attached, just execute boundary timer instead of complete user task.

appreciate your suggestions.

Thanks,
JDP

jdp
Confirmed Champ
Confirmed Champ
Hi Martin,

I am trying to create unit test for the same, seems it will take time, meanwhile can you please give some advise on this.

Thanks,
JDP

jdp
Confirmed Champ
Confirmed Champ
Hi Martin,

I have created unit test for above mentioned scenario, please find attached. Test case contains logic to find workflow execution path and as a output this test case will create workflow image file with execution path in RED font same as activiti explorer.

below dependency needs to be added in pom file :
<dependency>
   <groupId>org.apache.commons</groupId>
   <artifactId>commons-io</artifactId>
   <version>1.3.2</version>
  </dependency>

Please check and suggest.

Thanks,
JDP





jdp
Confirmed Champ
Confirmed Champ
Hi Martin,

I think this problem is related to activiti explorer, as it is highlighting invalid execution path in workflow image, should I raise this problem in Activiti Explorer forum ?

Please advise.

Thanks,
JDP

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi JDP,

I tried to execute your jUnit test. I see following issues:
1. pom.xml is missing (What are the dependencies? Dependencies are important.)
2. there is no assertion. What do you expect there?

Could you provide a link to git hub project (or whole project zip) with failing test please?

Regards
Martin

jdp
Confirmed Champ
Confirmed Champ
Hi Martin,

Please refer attached "ActivitiUnitTest" rar file which contains whole unit test project with failure test. I have added assertion as well, I am expecting execution flow from boundary timer to exclusive gateway which is not there in result and actual execution path is from boundary timer to exclusive gateway.

Note that after assertion, there will be workflow diagram generation code which will generate png image shows workflow with execution path in RED font.


Thanks,
JDP

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi JDP,

thanks for the test. It is really easy to find why the flow is not highlighted.

The problem is that A3 is not added to the list of activities processDefinition.getActivities().
Parser properly gets boundary event (that's why it is displayed on the diagram).
I would say that ProcessDefinition needs a fix.

Regards
Martin