cancel
Showing results for 
Search instead for 
Did you mean: 

Please help in my use case. Waiting at receive task for a process variable to become true

monika_b
Champ in-the-making
Champ in-the-making
Hi all,

I am using Receive Task with Timer Boundary event that should get cancelled once conditional expression evaluates true.

Requirement:
Need a waiting state in activiti flow that has a java service task(or receive task with java class call in listener possible?) attached that fetches a variable in ACT tables. If variable is found 'false' should proceed with the flow cancelling the wait. Else wait there itself.
Note: This activiti variable will be updated true/false externally anytime/anyday. Based on which our activiti flow should be proceeded after wait.

Q: Do I need a timer event that calls this java service call to consistently check if the act variable value gets changed??
Q: Please guide me how to implement this use case.

I have attached my bpmn20.xml file that is not working currently.
In this, I am having below elements:
I have a sequence flow that goes to receive task which has a listener attached that calls a history table ACT_HI_VARINST to check if variable is true/false. This receive task has a Timer Boundary Event with timecycle(R3/PT2M).   If variable is found 'false' proceed to another java service task and ends of workflow.

Thanks in advance for any help. Please help me with my use case. I understand I can have 'call activiti'. Please in that case, please elaborate how to use it in my case.






4 REPLIES 4

monika_b
Champ in-the-making
Champ in-the-making
Able to resolve it myself.

jbarrez
Star Contributor
Star Contributor
Could you elaborate on your solution? Maybe people that find this post through Google would like to know it.

monika_b
Champ in-the-making
Champ in-the-making
yes, for this basically I had a subprocess with timer defined within this I had a receive task that has a java class listener attached that eventually sets a process variable based on some logic(custom logic). This boolean variable is then passed as conditional expression to exclusive gateway that eventually either goes to a java service task (if false), else goes to the end event. In former case, the java service task again goes to the subprocess. Timer basically used for polling.
I dont knw how to post my activiti diagram else it would have been easier to understand.

jbarrez
Star Contributor
Star Contributor
That makes sense, thanks!