Time for action – adding scopes
Let's create two scopes and add those two
<invoke>
activities into those two scopes separately, so we can define local variables, partner links, and so on, which are only visible within a particular<scope>
activity. So drag-and-drop the<scope>
activities inside the sequences where the<invoke>
activities are, as shown in the following screenshot:Now we can drag the existing
<invoke>
activities into the newly added<scope>
activities:Now, the remaining task is to transfer the variables from the global phase to local phase. If you look at the variable hierarchy within the process definition, it looks like the following screenshot:
There is not a straightforward transfer mechanism. So, to transfer what we can do is to clone the definition on the global variable within the
<scope>
activity and delete the global variable. So, the final variable hierarchy within the process definition will be as shown:Likewise we can further...