Handling Data in the Process

Activities manipulate workflow relevant data. In the support management process of ACME a set of data items describing the support case, e.g. a description of the problem, a reference to the customer reporting the problem, etc. will be created by the Create Case activity and then passed to other applications to be changed or augmented with other data items related to the support case. The data structures or variable definitions used in this process must now be defined in the model. Our ACME example will use the Structured Data type to represent the case data.

Creating a Data Resource

To create a data element:

  1. In the diagrams toolbar palette click Data.
  2. In the pull-down menu, select the data type you want (in this case Structured Data).
  3. Move the cursor to the diagram canvas and place the data symbol there by clicking on the canvas.


Figure: Adding a Data Element to the Process Definition

! Tip: To facilitate property settings for data and data mappings, select the automatic Id generation provided in the Process Manager preferences. Per default, automatic Id generation is enabled. For details on how to set this preference please refer to section Enable Auto Id Generation of chapter Setting Process Manager Preferences.

Changing Properties of Data (Dereferencing)

Data may be of various types. The support case data has been priory defined in the bean org.eclipse.stardust.examples.supportcase.SupportCase, so defining the data in our model will consist in setting a reference to this class.

  1. By double-clicking on the Data symbol, open the properties dialog of the data element.
  2. Change the Name to Support Case Data. The ID will become SupportCaseData.
  3. From the left pane of the dialog, click Structured Data Definition.
  4. In the Declared Types section select Customer.

Data Properties Dialog
Figure: Data Properties Dialog

Setting up Data as Output of a non-interactive Activity

The data definition we have created will keep the support case information and make it available for all activities in our process. The difference consists in the relationships between the support case data and the diverse activities. First, an instance of the Support Case Data class needs to be created so it can be used by other activities. Init Data will perform the object instantiation. In Enter Data the activity will only output case information to the Support Case Data object instance. Then the activity Analyze To Solve uses the data (modified or supplemented within this activity) as both input and output. Finally, the remaining activities in the process use the same data element as the input data only.

We proceed with setting this data mapping between the data element and the Init Data activity.

  1. Select Connect on the diagram toolbar palette
  2. Click the activity Init Data and subsequently the Support Case Data.

Data mapping Creation
Figure: Data mapping Creation

Now you have created a data mapping between an activity and a data.

! Tip: You can open the data mapping properties dialog by double-clicking on the light gray arrow or you can open the activity properties dialog and switch to the data mappings in the left tree of that dialog. In these dialogs you can add, edit or delete data mappings. In the data mapping properties dialog you can only see the mappings of that specify mapping, in this case of activity Init Data and Support Case Data. If you open the activity properties dialog you can access all mappings connected to that activity.

  1. Open the data mapping properties dialog of the new created data mapping as described above.
  2. Select application:SupportCaseData from the OUT Data Mappings on from the left pane of the dialog.
  3. Use the Access Point drop-down list to select returnvalue : Map. This is the return value of the previous defined completion method of the Support Case Factory.
  4. Notice the direction of the arrow on the Out Data Mappings icon in the left pane of the dialog. The arrow pointing at the data indicates this activity is changing the data (Support Case Data). The Access Point is the method to invoke on the application (CreateSuupportDataAppl) associated with this process activity (Init Data). The result of the method invocation is written to the data object (Support Case Data). Think of the Infinity Process Platform activity as the bridge between data and an application, where data could flow in either direction. The mapping names are from the perspective of the Infinity Process Platform activity. Thus, an Out Data Mapping is data flowing out of the activity. In this case, the result of the method (the application access point) is used as output data (mapped) to an object instance.
  5. Click OK.

Data Mapping Properties
Figure: Data Mapping Properties

Setting up Data as Output of the Interactive Activity Enter Data

Next we turn our attention to Enter Data, the first activity in the process to interact with a human. The steps will be similar to those used for the non-Interactive application. However, because Enter Data is a Manual activity you will provide additional detail, so that later, the Infinity Portal features can automatically render a user interface to present the data.

Start with setting the out data mappings:

  1. Open the activity properties dialog of the Enter Data activity by double-clicking on its symbol in the diagram.
  2. Select Out Data Mappings from the left pane of the dialog.
  3. Choose the default context and click the Add button.
  4. The dialog content changes to provide mapping details.
  5. Select Support Case Data from the Data drop-down list. This is the serializable object representing the entire case.
  6. In the Name field enter CustomerID and make sure the Id is also CustomerID. This name will later be used as a user prompt in the final user interface.

Enter Data mapping
Figure: Creating an Output Mapping with modified Name

To specify the data path:

  1. Click the Browse button displayed next to the Data Path text box
  2. Select the data path Id.
  3. Click Finish to return to the Enter Data properties dialog. The Data Path is now Id.


Figure: Browse Content

To create the next out data mapping:

  1. Click the Add button to create another output mapping.
  2. Again, in the Data drop-down list select Support Case Data.
  3. Enter CustomerName in the Name field and make sure the Id is also CustomerName.
  4. Click Browse on the Data Path and select the element Name.
  5. Enter Data properties now has two output mappings in its left hand pane (CustomerID and CustomerName).

Data Mapping Property Dialog
Figure: Data Mapping Property Dialog

Continue to use the Add button to create an Out Data Mappings with name and Id eMail and to data path element Email.

Again use the Add button to create an out data mapping with name and Id ProductName. To create the data path element:

  1. Click the data path Browse button.
  2. In the data path dialog select Product.
  3. Click the Next button.

Add the Product Element.
Figure: Add the Product Element.

  1. Select the element Name.
  2. Click Finish.

Add the Product Name Element.
Figure: Add the ProductName Element.

Now the out data mapping for the product name is created:

ProductName Out Data Mapping
Figure: The ProductName Out Data Mapping

In the same way create an out data mapping with the name and Id Synopsis, which maps to data path element Product/Synopsis.

Add the Synopsis Out Data Mapping.
Figure: Add the Synopsis Out Data Mapping.

When you have performed these steps, there will be a total of five Out Data mappings in the left pane of Enter Data properties:

Enter Data - all data-mappings
Figure: Data Mappings after Configuration

Setting up Data as Input of the Interactive Activity Enter Data

Now proceed with the setting of the In data mappings in the same way as the Out data mappings described above. Create the following In data mappings with the same Id and name as the Out data mappings:

  1. CustomerName with data path element Name
  2. CustomerID with data path element ID
  3. eMail with data path element Email
  4. ProductName with data path element Product/Name
  5. Synopsis with data path element Product/Synopsis

When you have performed these steps, there will be a total of five In Data mappings in the left pane of Enter Data properties:

Enter Data - all data-mappings
Figure: Data Mappings after Configuration

The In data mappings have the same Ids as the out data mappings, so that they can be stored during a Suspend and Save option in the Workflow Execution Perspective. Please refer to chapter Suspending Activities of the Infinity Portal documentation for detailed information on this option.

Setting up Data as Input/Output of the Interactive Activity Analyze To Solve

The second human activity of the ACME process, Analyze To Solve, needs both input and output data mappings. The procedure is very similar to the one used for Out Data Mappings in Enter Data (see above).

  1. Open the activity properties dialog of the Analyze To Solve activity by double-clicking on its symbol in the diagram.
  2. Select In Data Mappings from the left pane of the dialog.
  3. Choose the default context and click the Add button.
  4. The dialog content changes to provide mapping details.
  5. Use the Data drop-down list to select Support Case Data. This is the data object representing the entire case.
  6. In the Name field enter CustomerID and make sure the Id is also CustomerID. This name will later be used as a user prompt in the final user interface.
  7. Use the Browse button on the Data Path to select the Id element.
  8. After these steps, the Analyze To Solve properties will look like this:

Analyze to Solve
Figure: Mappings of Interactive Activity

Press the Add button to add more In Data Mappings as follows:

When these steps are completed, Analyze To Solve shows the following In Data Mappings:

Analyze To Solve in maps
Figure: Data Mappings after Configuration

Notice the arrows on the data icons under In Data Mappings. The arrow pointing away from the data indicates these fields will come into the activity for use, but these input mappings will not cause the data to be changed at its source (the Support Case Data object). Out Data Mappings are required to change the data at its source.

Now, create Out Data Mappings for Analyze To Solve, following a procedure similar to the one used for Enter Data above. Create the Out Data Mappings as follows:

When these steps are complete, Analyze To Solve will have this appearance:

Analyze To Solve, all mappings
Figure: Out Data Mappings

Deliver Patch is also an interactive activity which needs an In Data Mapping for e-mail (allowing the customer to be sent a software patch in the ACME example). Following the examples above, add the following In Data Mapping to Deliver Patch:

Setting up Data as Input of a non-interactive Activity

The last activity to be configured for data is Notify Customer:

  1. Double-click the activity symbol of Notify Customer to open its properties dialog.
  2. Select In Data Mappings from the left pane of the dialog.
  3. Choose the application context and click the Add button.
  4. The dialog content changes to provide mapping details.
  5. Use the Data drop-down list and select Support Case Data. This is the serializable object representing the entire case.
  6. Use the Access Point drop-down list to select mParam1 : Map.
  7. After these steps, the Notify Customer properties will look like this:

Notify Cust mappings
Figure: Non-Interactive Application Data Mappings

Summary

The table below summarizes the data mappings carried out in this section:

Activity Type Context Data Path Access Point
Init Data OUT non interactive App returnValue : Map (sets the complete Support Case Data complex type)
Enter Data IN default structured data path elements
  • ID
  • Name
  • Email
  • Product/Name
  • Product/Synopsis
implicit in Manual Activity
Enter Data OUT default structured data path elements
  • ID
  • Name
  • Email
  • Product/Name
  • Product/Synopsis
implicit in Manual Activity
Analyze To Solve OUT default structured data path elements
  • Product/State
  • Product/Analysis
implicit in Manual Activity
Analyze To Solve IN default structured data path elements
  • ID
  • Name
  • Email
  • Product/Name
  • Product/Synopsis
  • Product/State
  • Product/Analysis
implicit in Manual Activity
Deliver Patch IN default structured data path element Email implicit in Manual Activity
Notify Customer IN non interactive App mParam1 : Map (retrieves the complete Support Case Data complex type)

! Tip: You may find it helpful to remember two rules for Infinity Process Platform data mappings:

  1. For In Data Mappings - get from the data, set the corresponding application (Access Point)
  2. For Out Data Mappings - get from the application, set the corresponding data (Path)

For most of the activities in this tutorial, the application is implicit via a manual activity, where Infinity Process Platform automatically provides the user interface application. Other processes may use explicit applications and related mappings. These two rules consistently follow the activity perspective involved in Data Mappings.

At this point of the ACME Tutorial, your process diagram should be similar to this:

Diagram after mappings
Figure: Finished Data Mappings