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.
To create a data element:
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.
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.
Support
Case Data. The ID will become SupportCaseData.
Figure: Data Properties Dialog
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.
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.
returnvalue :
Map. This is the return value of the previous defined completion method of the Support Case Factory.
Figure: Data Mapping Properties
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 Stardust Portal features can automatically render a user interface to present the data.
Start with setting the out data mappings:
Figure: Creating an Output Mapping with modified Name
To specify the data path:
Id.
Figure: Browse Content
To create the next out data mapping:
Name.
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:
Figure: Add the Product Element.
Figure: Add the ProductName Element.
Now the out data mapping for the product name is created:
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.
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:
Figure: Data Mappings after Configuration
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:
NameIDEmailProduct/NameProduct/SynopsisWhen you have performed these steps, there will be a total of five In Data mappings in the left pane of Enter Data properties:
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 Stardust Portal documentation for detailed information on this option.
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).
Figure: Mappings of Interactive Activity
Press the Add button to add more In Data Mappings as follows:
NameEmailProduct/NameProduct/SynopsisProduct/StateProduct/AnalysisWhen these steps are completed, Analyze To Solve shows the following In Data Mappings:
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:
Product/AnalysisProduct/StateWhen these steps are complete, Analyze To Solve will have this appearance:
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:
EmailThe last activity to be configured for data is Notify Customer:
mParam1 : Map.
Figure: Non-Interactive Application Data Mappings
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
|
implicit in Manual Activity |
| Enter Data | OUT | default | structured data path elements
|
implicit in Manual Activity |
| Analyze To Solve | OUT | default | structured data path elements
|
implicit in Manual Activity |
| Analyze To Solve | IN | default | structured data path elements
| 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 Stardust data mappings:
For most of the activities in this tutorial, the application is implicit via a manual activity, where Stardust 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:
Figure: Finished Data Mappings