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

Sub-processes may or may not have the same Process Entity as their Parent process. Thus, to access the parents case's information you must 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.

 

 

To make the information of the Parent process available from the Sub-process, there must be a 'mapping' process before entering the Sub-process. The information of the Parent process that must be available in the Sub-process must be defined and related before entering. Thus, new attributes must be created in the Sub-process to be able to map them.

 

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).

 

Managing entities

 

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

In the Sub-process, attributes are reached navigating: <Payment.PaymentOption>

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).

 

Managing entities3

 

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).

 

Managing entities7

4. Create an expression element.

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

 

Managing entities8

 

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

 

Managing entities9

 

//Associate the information to be reused

<Invoice.Payment.PaymentAmount>=<Invoice.InvoiceAmount>;

<Invoice.Payment.PaymentDueDate>=<Invoice.InvoiceDueDate>;

//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.

 

note_pin

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>