<process-definition
name="milestone"
revision="1.0"
>
<!-- flow body -->
<sequence>
<participant ref="b" />
<set variable="/m" value="true" />
<concurrence
sync="generic"
count="1"
remaining="cancel"
>
<subprocess ref="a" />
<sequence>
<participant ref="c" />
<set variable="/m" value="false" />
</sequence>
</concurrence>
</sequence>
<!-- subprocesses -->
<process-definition name="a">
<if>
<equals variable-value="/m" other-value="true" />
<!-- then -->
<sequence>
<participant ref="a" />
<subprocess ref="a" />
</sequence>
</if>
<!-- implicit termination of subflow -->
</process-definition>
</process-definition>
Once again, recursion is used to implement this pattern. As long as participant 'b' has not treated its workitem (and the milestone has not been thus reached), participant 'a' repeatedly works on his workitem.
The 'deferred-choice' synchronization on the concurrence between 'a' and 'c' ensures that as soon as 'c' replies, the branch of 'a' will get cancelled.