uCosminexus Service Platform, Basic Development Guide
When defining a business process, you can include characters, numeric values to be included in messages, numeric values that become terms in conditional expressions, or messages as variables. Because variable values can be recorded in a database, they can be managed as execution history.
There are two types of variables: global variables and local variables.
In variables, you can define the values of following types. You can save the variable only for the value of defined type.
You can assign variables to the activities and items shown in the following table.
Table 5-4 Activities and items to which variables can be assigned
Activity | Item | Allocated contents | Remarks |
---|---|---|---|
Receive activity | Request message | Variable of message type for referencing the request message received from the service requester | It is used in also in specification of correlation set. |
Reply activity | Response message | Variable of message type for referencing response message or fault message to the service requester | |
Invoke service activity (synchronous) | Request message | Variable of message type for referencing the request message when invoking the synchronous service | |
Response message | Variable of message type for referencing the response message received from the invoked synchronous service | ||
Fault message | Variable of message type for referencing response message to be received when fault occurs in the invoked synchronous service | -- | |
Invoke service activity (asynchronous) | Request message | Variable for message type for referencing the request message when invoking the asynchronous service | It is used also in the specification of correlation set |
Invoke java activity | Argument | Variable for referencing the value, which serves as argument when invoking the user-created Java class | -- |
Return value | Variable for referencing the return value from the invoked Java class | -- | |
Data transformation activity | Transformation source data | This is variable of message type for referencing the transformation source data when transforming the data in data transformation activity and you can specify multiple variables | -- |
Transformation destination data | Variable of the message type for referencing the transformation destination data when transforming the data in the data transformation activity | -- | |
Assign activity | Copy source | Variable for referencing the data that serves as copy source when copying the data in assign activity | -- |
Copy destination | Variable for referencing the data that serves as copy destination when copying the data in assign activity | -- | |
Throw activity | Fault message | Variable of message type for referencing the fault message, when throwing fault in the throw activity | -- |
Standby activity | Standby time | Variable for referencing the value of standby time | -- |
Validate activity | Variables to be validated | Variable to be validated | -- |
While activity | Repetition condition | Variable for referencing the value of while loop variable or end condition expression | -- |
Repetition list | Variable for referencing in the expression for acquiring the repetition list | -- | |
Repetition element variable | Variable for storing the repetition element | -- | |
Switch activity | Distribution condition | Variable for referencing the value that serves as item of distribution condition expression | -- |
Clicking the Show Tree button in the Variable-Correlation Set dialog box opens XML schema viewer Parameters. You can show XML schemas that match variables in a tree view. When you choose a variable displayed in the tree view, the path to the chooseed variable is displayed in Chooseed path as an absolute path from the root element.
When you choose and right-click a variable and choose Get Path, you can obtain the absolute path from the root element. You can paste the acquired path in the desired location.
You can add or edit variables that are used by activities inside business processes or scopes. In this case, variables declared outside a scope can be referenced from inside the scope, but variables declared inside a scope cannot be referenced from outside the scope. Note that the same variable names can be declared within different scopes. In the following figure, while Scope A and Scope B can reference variables outside their scope in other parts of the process, the variables of Scope A and Scope B cannot be referenced from the process (from outside their scope).
Figure 5-5 Relationship between a scope and variables
When defining fault handling for a scope activity, choose the variable to be used as an assign variable in the Fault Handler dialog box. The chooseable variables are those that are defined in the fault-target scope (including a scope activity) or a scope on the outside. However, if a variable having the same name as the variable chooseed in the Fault Handler dialog box is also defined in the fault-target scope, the variable defined in the fault-target scope, and not the variable chooseed in the Fault Handler dialog box, is used during execution, and may result in unintended operations. Therefore, when defining fault handling for a scope activity, ensure that no variable having the same name as the variable chooseed in the Fault Handler dialog box is defined in the fault-target scope.
You can change or delete the definition information (variable name, type, message format and part) of variable and correlation set as and when required.
When executing a business process, you must set a numeric value or message, which can serve as item of numeric value or condition expression, included in the character or message, in the variable.
When receiving a request from the service requester or receiving a response from the service by Invoke service activity, a value has been entered in the variable. However, in other cases, you must set a value to variable ,(initialize) by using data transformation activity or Switch activity.
Following section describes the cases when variable initialization is not required:
For the variables specified in the following locations, value has been set before referencing the variable (message) and hence you need not initialize these variables:
Following figure shows the example when initializing a variable is not required:
Figure 5-6 Examples when initialing a variable is not required
Description about the cases when initializing a variable is required, is as follows:
As value is not set for the variable not specified in the location shown when initializing the variable is not required, if you reference such variables in a business process, an error occurs. You must set the value beforehand and initialize the variable.
Following are the locations where variables for which value has not been set, can be specified:
Following figure shows the examples of cases when initializing a variable is required:
Figure 5-7 Example when initializing a variable is required
The procedure for defining new variables is described below. Note that variables cannot be defined on a canvas inside a while activity.
If the message format definition file specified during the definition of the variable is modified, the contents of the modified definition file can be committed using the following procedure:
Description about a method to output a message format definition file is as follows:
When you want to set the message format of variable set in the activity at copy source, to the variable of activity at copy destination, you can output a message format definition file in the Variable/correlation set list dialog.
Format of the message format definition file that you can output, is either of the following formats:
Procedure to output the message format definition file is as follows:
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.