Managing Sub-Process entities

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Model Process > Modeling for execution > Sub-Processes > Reusable Sub-Processes >

Managing Sub-Process entities

Depending on the Sub-Processes it may not have the same Process Entity as their Parent process. Thus, to access the parents case's information consider the context of both processes to evaluate how to navigate the data model.


Reusable Sub-Processes may or may not have the same Process Entity as the Parent process.

If the Sub-Process has the SAME Process Entity as the Parent process, the information of the Parent process will be available in the exact same XPath. The data navigation will not change form one process to the other.


If they do NOT have the same Process Entity, the information of the Parent Process is not accessible from the Sub-Process. You can create attributes for the information you need in the sub-process's Process Entity, and map those attributes from the parent process's entity. This mapping must be defined and related before entering the sub-process.


Accessing the information of the Parent process from the Sub-Process

Let's suppose we have the following Processes:


Parent Process: Invoice (whose Process Entity is Invoice)  

Reusable Sub-Process: Payments (whose Process Entity is Payment).




In the Parent process attributes are reached navigating: <Invoice.InvoiceAmount>

In the Sub-Process, attributes are reached navigating: <Payment.PaymentAmount>

Note that the start point is different because the Process entity is different. Thus we say that the Context is different.  


To make the information of the Invoice process available in the Payment Sub-Process follow this steps:


1. You need a relationship between both Process entities in the Data Model.

Create the Payment attribute in the Invoice entity and relate it to the Sub-Process entity (Payment).




2. Identify which attributes of the Parent process are expected to be shown in the Sub-Process.

Create them in the Sub-Process main entity.


In this case we want to display the Invoice amount and the Invoice Due Date from the Parent process in the forms of the Sub-Process.

Thus, we create two new attributes in the Payment entity, called Payment Amount and Payment Due Date to map them.


3. Create an expression as an On enter action of the Sub-Process (holding the Shift key while clicking).




4. Create an expression element.

Associate (map) the information from the Parent Process to be used in the Sub-Process.




5. Finally associate the instance of the Sub-Process entity to the attribute in the Parent process used to reference the Sub-Process.




//Associate the information to be reused



//Associate the Sub-Process instance to the Parent process

<Payment> = <Invoice.Payment>;


Information of the Parent process can now be accessed from the Sub-Process.



If you need to update the parent process with information entered in the Sub-Process, you need to create an expression On Exit of the Sub-Process that maps the required information.

If we need to update the InvoiceAmount in the Parent process the expression will be the opposite of the mapping in, and look like this:


<Invoice.InvoiceAmount> = <Payment.PaymentAmount>


Additionally, when your business has that information from the parent process changes and the sub-process information must be updated, you can use a message event to sent the information between the processes.