Table of Contents
Sometimes a process model can be large and you wish to split them into smaller models to make each piece easier to manage. You might also wish to create a library of processes, fragments, that can be reused in other processes, e.g. an approval fragment or a decision form in an application process. Modularization ensures processes can be re-used and don't grow too big.
The application process outlined below serves as an example.
The applicant fills out a form. Once done the caseworker reviews the applications. If the application is a specific type, applicationtype=1, then an extra step must be done before the board can make a decision.
If a caseworker approves review a board member review process starts that can lead in payout if a board member also approves the process.
"Round approved" is a global activity, meaning that it is happening in another model. Once "Round approved" is executed, the "payout" activity can be executed (provided that the additional "Approve" application has been executed as well).
ApplicationType is used as a guard. If ApplicationType is 1, then an extra step must be done in the review phase by the caseworker.

We have made the process model public, and we encourage you to make a copy of the process model and experiment with the new feature.
Process fragments are now in beta so you can experiment with it. We reserve the rights to change semantics so we encourage you not to use it in production yet.
Externalizing part of the model as a fragment
We can externalize the form by clicking on the form and in the Options-->Advanced tab click the Externalize button as outlined below.

When you click Externalize button the following steps happen:
- The subprocess, here the DCR Form, is created as a separate process model
- The subprocess is removed from the parent model and instead, a reference to the newly created fragment is inserted
- Finally, interface activities are mapped from the outer model to inner form and from inner form to outer model
The subprocess, the DCR Form, is simply a model containing the activities of the main model, and is outlined below:

We notice that the form contains the exact same activities as found in the parent model above.
In the parent model we replace the inline DCR Form with a reference to the fragment:

Notice the link icon in the lower-left corner of the form. This indicates that this is a linked fragment, and if we click on the form and check in Options-->Advanced we can see the link to the fragment containing the form.

The activity ApplicationType is part of the parent model. The reason is that ApplicationType is used as a guard in the parent model and therefore can be characterized as an interface activity from inner.

Two types of interface activities exist:
- From Inner - this means that this activity is needed from the inner model
- From Outer - this means that this activity is needed in the inner model from the outer model
We can inspect the interface activities from the specific fragment by clicking on Grouping Type menu to the right of Form in the Options-->Advanced panel:

When we will see the mapping of interface activities from the outer model to inner and from the inner model to outer.

Here we only have an interface activity from inner. This means that the ApplicationType in the parent model must be linked with an activity in the inner model, the DCR Form. When externalizing a DCR Form the mapping will be filled out automatically and the activity id will be identical.
Interface activities from outer
Interface activities from outer exist if the inner model either refer to outer activities in guards or rules cross the boundary between the outer and the inner model.
Interface activities from outer are not really part of the subprocess and thus cannot be executed within the subprocess. The only reason it is included in the subprocess is that the marking of the activity is needed within the subprocess.
So interface activities from outer are not visible if a DCR Form and similar will not be shown in tasks lists.
Simulation with process fragments
When you simulate models that contain fragments we splice these fragments into the main model when the simulation starts.
Future plans
We will extend process fragments so it is possible to replace and edit the link to the process fragment.
You can already create libraries of fragments. We will recommend that you place fragments in a category that can be shared among several users.
We will also make it possible to simulate models with process fragments without including the process fragment in the simulation. This makes simulation simpler as we only need to simulate the part that affects the process.