Hmm that is indeed a good use case… However I don't think we have out of the box support for it like you describe.
A workaround could be to have a looping mechanism in the process before service-task-2, that checks the var, and if not correct goes into an intermediary timer for xx seconds/minutes/whatever/… effectively looping/blocking until the var is set.
Ah now that I think of it! Forget that last sentence. Too hacky.
Two solutions:
- Use a receive task before the service task 2. have a sequence flow listener that signals the execution waiting in the receive task
- Use a signal throw after the repetitive task and a catch on the boundary of a receive task before service task 2. Set the signal scope to process instance scope.