| Modeling and Implementation Guide for Oracle Business Process Management |
This chapter describes how to handle the information in your process using data objects and project data objects. It also shows you how to pass that information along the process and how to transform it when necessary.
This chapter includes the following sections:
Generally processes access and store information. Often the process flow is based on the value of this information. In other cases this information is the result of running the tasks in the process.
Oracle BPM supports the following data structures to keep track of this information:
Process Data Objects
Sub-Process Data Objects
Project Data Objects
Arguments
Additionally, you can pass information between the different elements of a process using data associations.
The main elements that compose a business process are a workflow and information related to that workflow. The information of a process may change as you run the process. This information defines the state of a process at a given time.
This information determines how the process behaves for a particular instance. According to the value of this information the instance may take one path or another. You may monitor this information or store it to an external system.
The main elements that compose a business process are a workflow and information related to that workflow. The information of a process may change as the process runs. This information defines the state of a process at a given time.
The purchase order process uses the following information:
total amount
payment type
customer ID
shipping cost
Oracle BPM uses data objects to store the information related to the process. The value of these variables may or may not change as you run the process.
Oracle BPM data objects have the following characteristics:
A name that identifies the data object
A data type that determines the type of data that can be stored in the variable.
Data objects store information related to each process instance you create. The value of these data objects is different for every instance in the process.
When you define a process you must define the data object to store information. You must also define in which part of the process you assign a value to these data objects. The value of data objects may come from the user input, from external systems or might be calculated based on other data objects.
When you create an instance, the Process Engine assings Null as the default value for all the data objects defined for that process. Later on the activities in the process assign values to these variables.
In the purchase order process each order has its own total amount, payment type and customer ID. You can model this data data by defining data objects that store this process information.
You can add new process data objects to the process you are working on. If necessary you can edit or remove them after you create them.
Typically the services in your process modify the value of the data objects in your process, but you might assign them an initial value, or change their value during the process.
To add a process data object:
In the Project Navigator window, select the process where you want to add the data object.
In the Structure window, right-click the Process Data Objects node.
Select New.
Enter a name to identify the data object.
See
Select a type from the Type list or click the Browse More Types button to select a type that is not included in the list.
Click OK.
To edit a process data object:
In the Project Navigator window, select the process that contains the data object you want to edit.
In the Structure window, expand the Process Data Objects node.
Right-click the data object you wan to edit.
Select Edit.
A dialog to edit the data object name and type appears.
Make the changes you want.
Click OK.
To delete a data object:
In the Project Navigator window, select the process that contains the data object you want to edit.
In the Structure window, expand the Process Data Objects node.
Right-click the data object you want to edit.
Select Delete.
A confirmation message appears.
Click OK.
To assign a value to a process data object:
In the Process Editor, add a script task to the process.
Edit the implementation properties of the script task.
Define the data association or transformation to assign the value to the process data object.
See Section 8.13, "Introduction to Data Associations" for information on how to define a data association.
See Section 8.14, "Introduction to Transformations" for information on how to define a transformation.
There is certain data, like the status of the process, that applies to all the process you defined. You can use this data to trigger an event based on its value, or to provide it as input to a service. In both cases the process flow depends on the value of this data.
Oracle BPM tracks this data using a predefined set of data objects. You can access this data objects in the same way you access regular data objects, but you cannot assign them new values.
Table 8-1 provides detailed information about the predefined data objects available for the different elements of a process.
Table 8-1 Predefined Data Objects
| Name | Type | Description | Availability |
|---|---|---|---|
|
state |
String |
Possible values are:
|
At process level. |
|
state |
String |
Specifies the state of the instance sitting in this activity. Possible values are:
|
In user tasks. |
|
actualOwner |
String |
Specifies the user assigned to the instance sitting in this activity. |
In user tasks. |
|
taskPriority |
Int |
Specifies the priority of the that the end user sees. This priority helps the user identify the importance of the task. Possible values are: |
In user tasks. |
|
loopCounter |
Int |
Specifies the number of times the engine ran this activity. The Process Engine updates this variable each time it runs a new loop. |
In activities with loop marker. |
|
loopCounter |
Int |
Specifies the sequence number that identifies each of the activations of this activity. The BPMN Engine assigns this number to each activation when it runs the activity. |
In activities with multi-instance marker. |
|
numberOfInstances |
Int |
.Specifies the number of activations created for a multi-instance activity. You can only access this value from the main instance. |
In activities with multi-instance marker. |
|
numberOfActiveInstances |
Int |
Specifies the number of active inner instances for a multi-instance activity. You can only access this value from the main instance. For sequential multi-instance activities this value is either 1 or 0. For parallel multi-instance activities this value is smaller or equal to the value specified by the predefined data object numberOfInstances. |
In activities with multi-instance marker. |
|
numberOfCompletedInstances |
Int |
Specifies the number of completed inner instances for a a multi-instance activity. You can only access this value from the main instance. |
In activities with multi-instance marker. |
|
numberOfTerminatedInstances |
Int |
Specifies the number of terminated inner instances for a a multi-instance activity. You can only access this value from the main instance. |
In activities with multi-instance marker. |
|
activationCount |
Int |
Specifies the number of tokens in the incoming sequence flow of the gateway. |
In complex gateways. |
|
numParticipants |
Int |
Specifies the number of roles that a participant has in the collaborations defined in the BPM Project. |
In process elements marked as participants of a collaboration. |
Some process elements support predefined data objects. You can use these predefined data objects to control the flow of a process. Generally the Process Engine assigns the values of predefined data objects, however some of them require you to assign them a value.
You can define data objects for a certain sub-process. These data objects are available only when the sub-process is running. When the instance leaves the sub-process the value of sub-process data objects is lost.
Using sub-process data objects is a good practice because:
It reduces the number of unecessary data objects in the main process, making it simpler and easier to read.
By reducing the number of process data objects, it reduces the amount of memory each process instance occupies.
It makes the sub-process easier to understand.
From within a sub-process you can access process data objects and sub-process data objects. If the name of a sub-process data object matches the name of a process data object, then when you access the data object you obtain the value of the sub-process data object. CAT-TODO: Find out if you can access a process data object from within a sub-process.
You can add new project data objects to the project you are working on. If necessary you can edit or remove them.
To add a data object to a sub-process:
In the Project Navigator window, select the process that contains the sub-process where you want to add a data object.
In the Structure window, expand the Activities node.
Expand the node that corresponds to the sub-process.
Right-click the Data Objects node located under the sub-process node.
Select New.
Provide a name to identify the new data object.
Select a type or click the Browse More Types button to select a type that is not included in the list..
Click OK.
To edit a data object in a sub-process:
In the Project Navigator window, select the process that contains the sub-process with the data object you want to edit.
In the Structure window, expand the Activities node.
In the Structure window, expand the Activities node.
Expand the node that corresponds to the sub-process.
Expand the Data Objects node located under the sub-process node.
Right-click the data object you want to edit.
Select Edit.
A dialog to edit the data object name and type appears.
Make the changes you want.
Click OK.
To remove a data object from a sub-process:
In the Project Navigator window, select the process that contains the sub-process with the data object you want to remove.
In the Structure window, expand the Activities node.
In the Structure window, expand the Activities node.
Expand the node that corresponds to the sub-process.
Expand the Data Objects node located under the sub-process node.
Right-click the data object you want to remove.
Select Delete.
A confirmation dialog appears.
Click OK.
The processes in a BPM project often have a set of data they share. For example, the Purchase Order process and the Request Approval process may both track the value of the employee that created the request, or the priority of the request. The value of this data is different for every instance in each of those processes, they only share the necessity to keep track of that data.
Project data objects allow you to ensure that all the processes in a certain project keep track of a set of data. Then each process has to assign and update the value of this data.
The main benefit of defining project data objects is that after publishing your project you can configure WorkSpace views to show the values of those variables. This is only possible if you use project data objects.
Another benefit is that if you change the definition of a data object then you only have to do it one time, as opposed to having to make those changes in all the processes in the project that define the same data object.
|
Note: It is not advisable to change the data type of a project data object after deploying a BPM Project. This can cause problems when the Process WorkSpace tries to render the value of the instances created before changing the data type. |
When you mark a project data object as a business indicator the Process Engine stores its value in the BAM and DataMart databases. You can use this information to monitor the process activity.
For more information about Business Activity Monitoring, see Chapter 11, "Using Process Analytics".
You can add new project data objects to the project you are working on. If necessary you can edit or remove them.
To add a project data object:
In the BPM Project Navigator, select a project.
In the Structure window, right-click the Project Data Objects node.
Select New.
Provide a name to identify the new project data object.
Note: You cannot use the name of existing process data objects.
Select a type.
Some types allow you to define their lenght or decimal places.
Click OK.
To edit a project data object:
In the BPM Project Navigator window, select a project.
In the Structure window, expand the Project Data Objects node.
Right-click the project data object you want to edit.
Select Edit.
A dialog to edit the project data object properties appears.
Make the changes you want.
Click OK.
How to delete a project data object:
In the BPM Project Navigator window, select a project.
In the Structure windows, expand the Project Data Objects node.
Right-click the project data object you want to delete.
A confirmation message appears.
Click OK.
To assign a value to a project data object:
In the Process Editor, add a script task to the process.
Edit the implementation properties of the script task.
Define the data association or transformation to assign the value to the project data object.
See Section 8.13, "Introduction to Data Associations" for information on how to define a data association.
See Section 8.14, "Introduction to Transformations" for information on how to define a transformation.
You can use arguments to pass data between the different components in a process.
A component may require you to provide certain data when you invoke it. To pass this data you use input arguments.
When you run a component, it provides it results through its output arguments.
The process components that may have arguments are:
Service Operations: may require data to process and may provide data that contains the results of running them, the input and output arguments of the component represent this data.
Human Tasks: may require data to run and may provide data that contains the results of running them, the input and output arguments of the Human Task represent this data.
Business Rules: require an input that they use to evaluate the rules they contain, they return the result of this evaluation using output arguments.
Start Events: enable you to define input arguments. You can add input arguments to a start event when a process is used as a sub-process and it receives data from the invoking process. These input arguments represent the data that a process requires when another process invokes it.
End Events: enable you to define output arguments. You can add input arguments to an end event, when a process is used as a sub-process and passes information to the process that invokes it. These output arguments represent the data that result from running the process.
Catch Events: allow you to define input and output arguments that define the process interface. If the operation they expose is asynchronous, then you can only define input arguments. If the operation they expose is synchronous, then you can define input and output arguments.
Throw Events: enable you to define input and ouput arguments that define the process interface.If the operation they expose is asynchronous, then you can only define output arguments. If the operation they expose is synchronous, then you can define input and output arguments.
When you name a data object, a project data object or an argument, you should respect the following rules:
Use one or more nouns, or nouns modified by adjectives.
Do not start the name with a number.
Use capital letters only to distinguish internal words.
Keep names simple and descriptive.
Use whole words, avoid using acronyms, unless they are widely known.
The scope an acess varies according to the structure used to store information:
Process Data Objects: You can acess them from any task within the process. The Process Engine creates them when it creates an instance in the process. Generally the process data objects have different values for each instance in the process. After the instance arrives to the end event, you cannot access process data objects anymore.
Sub-Process Data Objects: You can access them from any task within a sub-process. The Process Engine creates them when the sub-process is triggered. After the instance leaves the sub-process, these data objects are no longer available.
Project Data Objects: You can define project data objects at a project level. Any process in the project has accesss to the project data objects. However the value of a project data object might vary between processes. Generally project data objects have different values for each instance in the process. You can acess project data objects from any process in a project, however the value assigned to it during a process is lost when the process finishes running. Figure 7-12 shows the difference between the scope and the life span of project data objects.
Arguments: You can only acess arguments from within data associations. You use arguments to pass information between processes or process components. When the Process Engine runs a process or a process element that contains a data association, it maps the value of the arguments to the data objects defined in the data association.
Data associations are used to pass the information stored in data objects in the following contexts:
To and from another process or service invoked from a BPMN process
To and from a Human Task service
To and from an Oracle Business Rule
To and from a script task. This BPMN flow object is used to pass data objects through data associations.
Table Figure 8-2 lists the flow objects where you can define data associations. It also lists the objects implemented.
Table 8-2 Flow Objects that Accept Data Associations
| Flow Objects | Implementation |
|---|---|
|
Message start and end events |
Services and other BPMN processes |
|
Message throw and catch events |
Services and other BPMN processes |
|
Send and receive tasks |
Services and other BPMN processes |
|
Script tasks |
Do not contain an implementation, are used to pass data objects through data associations. |
|
User tasks |
Oracle Human Tasks |
|
Business rule tasks |
Oracle Business Rules |
|
Service Tasks |
Services and BPMN processes |
You can use data associations to define the input and output from a flow object to an external service or process.
It is important to note that although the inputs and outputs are defined in the data associations for a flow object, the defined values are passed to the implemented systems and services.
You can use expressions to evaluate and change the input and output values
The data associations editor enables you to configure the input and output values passed between a flow object and a its implementation.
Figure 8-3 shows the data association for the Enter Quote user task in the Sales Quote example.
Table 8-3 describes the different areas of the data association editor.
Table 8-3 The Data Association Editor User Interface
| UI Area | Description |
|---|---|
|
Inputs |
Contains text boxes that display the data objects assigned as inputs to the service or process implemented in the flow object. Next to each text box is an icon that launches the expression editor |
|
Flow Object Interface |
Lists the expected input arguments for the service or process implemented. The flow object interface also contains an expandable list of the data objects supplied as input and output. Within the flow object area, you can expand complex data objects to map to specific basic data objects within a complex data object. |
|
Outputs |
Contains text boxes that display the data objects assigned as outputs from the service or process implemented in the flow object. |
|
Data Objects |
Displays a list of all the data objects. This list is divided between process and project data objects. |
You can use XSL tranformations to tranform:
the values of the data objects in the process, before you pass them to the implementation of a flow object as input arguments.
the values of the output arguments of a flow object implementation, before you assign them to the data objects in your process.
You can combine the use of transformations with the use of data associations only if you apply them over different arguments.
|
Note: You must not use transformations and data associations to map the value of an argument simultaneously. |
When you define the transformation you can only use as sources data objects that are based on an business object created using an XML schema or type.
You can modify the values you use assign to input arguments and output arguments in the implementation of a flow object using XSL tranformations.
You can define an XSLT tranformation to tranform the data you pass to and from the implementation of a flow object.
To Define a transformation:
Edit the flow object implementation properties.
Select Use Transformation.
Click the Edit XSL Transformation button.
The Tranformation dialog appears.
Click the input or ouput according to the argument value to transform.
Click Add.
The Transformation dialog appears.
From the Sources List, select a source.
The sources list only contains data objects that are based on on a business object created using an XML schema or type.
Click Add.
The source appears in the Selected Elements list.
From the Target list, select a target to assign the result of the transformation.
In the Tranformation section select a way to define the transformation:
Create: creates a new transformation and opens the SOA transformation editor for you to define the transformation.
Use Existing: enables you to select an exisiting transformation that you copied to the project XSL directory.