This Service
The This service is a multi-purpose utility service that obtains various information from a business process and its documents and makes this information available in process data. It also assigns and releases items from process data.
- Obtain different types of information from a business process and its documents.
- Make this information available to the user in process data.
- Assign and release (remove) items from process data.Note: The functionality of the This service is being replaced with other adapters and services designed more specifically to perform the services. The This service will be retired in the future.
Replacement Services
If you are developing a new application, you are strongly encouraged to select one of the replacement services as they are more easily integrated into a business process and provide additional functionality. The following services provide the functionality of the This service, plus additional features:
Service | Function |
---|---|
BP MetaData Info Service | The BP Metadata Info service enables you to retrieve information about a particular business process including:
|
Get Document Info Service | The Get Document Info service provides information about the primary document. You can query the service about information including the following:
|
Release Service | The Release service is a system service used to discard previous assignments in process data. |
TimeStamp Utility Service | The TimeStamp Utility Service enables you to create, format, and perform arithmetic operations on timestamp values in a business process. The following options are available with the Timestamp Utility service:
|
This Service Overview
The following table provides a high-level overview of the This service:
Category | Description |
---|---|
System name | This |
Graphical Process Modeler (GPM) categories | All Services, System |
Description | A multi-purpose utility service that obtains a variety of information from a business process and its documents and makes this information available in process data. It also assigns and releases items from process data. |
Business usage | Perform the following utility functions within the business process:
|
Usage example | The This service can be used in a variety of ways including getting time and date information for a business process, retrieving information about a document including the name and document ID, and loading and releasing information from process data. |
Preconfigured? | Yes |
Requires third-party files? | No |
Platform availability | All supported Sterling B2B Integrator platforms |
Related services | The functions available in the This service are being replaced by other adapters and services, including:
|
Application requirements | None |
Initiates business processes? | None |
Invocation | Runs as part of a business process. |
Business process context considerations | None |
Returned status values | Returned status values:
|
Restrictions | None |
Persistence level | None |
Testing considerations | Verify that you have an existing preconfigured This service. Create and test a business process that uses the This service and the desired functions. |
How the This Service Works
The This service can be used to access information and make it available to a business process in the process data and to remove specific items from process data.
Examples of all functions are included in Usage Examples.
Implementing the This Service
When implementing the This service for use in a business process, This service is normally preconfigured and available after Sterling B2B Integrator installation. If there is not an existing service configuration, then create a service configuration.
GPM Configuration and BPML Parameters
All Message To Service parameters for the This service are entered in the GPM using the Advanced Editor on the Message To tab. Message From Service parameters are entered by clicking Add on the Message From tab.
Input Parameters to the This Service
The following table describes the parameters input from the business process to the This service. These values are either coded in the BPML or set in the GPM configuration of the service. The BPML element values are provided in parentheses for reference.
Parameter (BPML Element Value) | Description |
---|---|
Document node name (documentKey) | The name of the node for the document in process data. Required for the takeDocument and giveDocument functions. |
Document Identifier (documentId) | The ID assigned by Sterling B2B Integrator for the document to load. Required for the takeDocument function. |
Source Node (from) | The node in process data to release or assign from. Required for assign and release. |
Target Node (to) | The node in process data to assign to. Required for assign. |
Append flag (append) | Replace duplicate assignment in process data. Optional. Valid values:
|
Trim whitespace flag (trimWhitespace) | Delete whitespace before the assignment is made. Optional. Valid values are:
|
Time Format syntax (format) | The syntax to format a millisecond timestamp. The standard 1.3.1 Java object SimpleDateformat is used to define the syntax (see Javadoc https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html for details). Optional. Default format is yyyy-MM-dd'T'HH:mm:ss. |
Universal Time flag (isTimeUTC) | The timestamp is in UTC. Optional. Valid values are:
|
Start time (startTimeMillis) | Start timestamp in milliseconds. This is the start time for the timeDiffRequest function. Required (timeDiff). |
End time (endTimeMillis) | End timestamp in milliseconds. This is the end time for the timeDiffRequest function. Required (timeDiff). |
Output Parameters to the Business Process/Process Data
The following table describes the parameters that are output from the This service to the business process. The term document in the table refers to the document that the This service is evaluating, either the primary document or another document in process data. The BPML element values are provided in parentheses for reference.
Parameter (BPML Element Value) | Description |
---|---|
Document Identifier (documentId) | The Document ID assigned by Sterling B2B Integrator for the document. |
Document Name (documentName) | The bodyName (file name) from the document. The file name is the name that is associated with the document, either the name of the file from the file system or the name assigned to the file by Sterling B2B Integrator. |
Timestamp (time) | Current timestamp. |
Timestamp difference (elapsedTimeMillis) | The elapsed time in milliseconds between the start time and end time entered as input to the This service. |
Output Messages
The name of the output message on Message To Service (message input to the This service) defines the functional behavior for the service. The function name is either typed in the Message Name field of the Message To tab in the Service Editor of the GPM or is coded in BPML as the output message (<output message="functionname">).
- thisRequest – Obtains the business process ID.
- giveDocumentRequest – Obtains the doc ID for the input document.
- takeDocumentRequest – Adds the document to process data.
- getDocumentName – Obtains the name of the document.
- releaseRequest – Releases the selected node from process data.
- assignRequest – Adds the requested item to process data.
- timeRequest – Obtains the current timestamp.
- timeDiffRequest – Obtains the elapsed time in milliseconds between two timestamps.
Usage Examples
The following examples illustrate how the different functions available in the This service might be implemented in a business process.
- Gets the current (start) time and assigns it to tag <time1> in process data.
- Gets the current time and formats it in process data.
- Gets the document ID of the primary document and places it in process data.
- Gets the business process ID and places it in process data.
- Gets the name of the primary document and places it in process data.
- Takes the primary document, assigns it to Document1 and makes a reference to it available in process data.
- Gets the current time and assigns it to tag <time2> in process data.
- Gets the time difference in milliseconds between time2 and time1 and assigns it to a variable in process data.
- Releases the primary document from process data.
This is the business process as shown in the GPM:
Each of the icons is a configuration of the This service configured to perform the actions that the name describes.
The following demonstrates the configuration for each of the This service functions in the GPM and the corresponding BPML. Process data is also shown for each example to demonstrate what is output to process data from the service.
Get Start Time and Get End Time (timeRequest function)
The Get Start Time and Get End Time configurations put the current time in process data. The Get Start Time and Get End Time configurations are the same except that the parameter name assigned to process data is time1 for the start time and time2 for the end time.
- Select Allow message write from the Input Msg drop-down list and click Add.
- In the Advanced Editor, assign * (asterisk) to time1, select the Use XPATH? check box, and click OK.
- Select Messages Only from the Output Msg drop-down list.
- Set Message Name to timeRequest.
The following illustration shows the BPML:
The timeRequest output is placed in process data within the <time1> tags. The <time> tag contains the time stamp that can be formatted. The <currentTimeMillis> tag always contains the time in milliseconds:
<time1>
<currentTimeMillis>1077632480082</currentTimeMillis>
<time>1077632480082</time>
</time1>
Format Time (timeRequest function)
The Format Time Configurations of the This service uses the timeRequest function and puts the formatted current time in process data. The format of the date is specified in the Message To Service format parameter. Format values used are the Java Simple Date Formats.
- Select Messages Only from the Output Message drop-down list.
- Set Message Name to timeRequest and click Add.
- In the Advanced Editor, assign yyyy-MM-dd:HH:mm:ss to format and click OK.
- Select Allow message write from the Input Msg drop-down list and click Add.
- In the Advanced Editor, assign * (asterisk) to time1 and click OK.
The following illustration shows the BPML:
The formatted time output is placed in process data within the <timestamp> tags:
<timestamp>
<time>2004-02-24:07:21:20</time>
</timestamp>
Get Doc ID (giveDocumentRequest function)
The Get Doc ID Configuration of the This service uses the giveDocumentRequest function. It gets the ID of the document (in this case the primary document) and puts it in process data.
- Select Allow Process Data write from the Input Msg drop-down list.
- Select Obtain process Data first, then Messages from the Output Msg drop-down list.
- Set Message Name to giveDocumentRequest and click Add.
- In the Advanced Editor, assign PrimaryDocument to documentKey, select the Use XPATH? check box, and click OK.
The following illustration shows the BPML:
The document ID output is placed in the process data within the <documentId> tags:
<documentId>L2000-000248:f96c:fae7d336aa:-784c</documentId>
Get Business Process ID (thisRequest function)
The Get Business Process ID configuration of the This service uses the thisRequest function. It gets the process ID for the business process and places it in process data.
- Select Allow message write from the Input Msg drop-down list and click Add.
- In the Advanced Editor, assign this/node() to thisProcessInstance, select the Use XPATH? check box, and click OK.
- Select Messages only from the Output Msg drop-down list.
- Set Message Name to thisRequest.
The following illustration shows the BPML:
<operation name="Get Business Process Id">
<participant name="This"/>
<output message="thisRequest"/>
<input message="inmsg">
<assign to="thisProcessInstance" from="this/node()"/>
</input>
</operation>
The business process ID output is placed in process data within the <thisProcessInstance><INVOKE_ID_LIST> tags.
<thisProcessInstance>
<INVOKE_ID_LIST>27031</INVOKE_ID_LIST>
</thisProcessInstance>
Get Document Name (getDocumentName)
The Get Document Name configuration of the This service gets the name of the primary document and places it in process data.
- Select Allow Process Data write from the Input Msg drop-down list.
- Set Message Name to getDocumentName.
- Select Obtain Process Data first, then Messages from the Output Msg drop-down list and click Add.
- In the Advanced Editor, assign PrimaryDocument to documentName, select the Use XPATH? check box, and click OK.
The following illustration shows the BPML:
The name of the document is placed in process data within the <documentName> tags. In this case the document being processed was named SampleDocument.xml :
<documentName>SampleDocument.xml</documentName>
Add Document to Process Data (takeDocumentRequest)
The Add Document to Process Data configuration of the This service adds a document to process data.
- Select Allow Process Data write from the Input Message drop-down list.
- Set Message Name to takeDocumentRequest.
- Select Messages Only from the Output Msg drop-down list and click Add.
- In the Advanced Editor, assign documentId/text() to documentId and select the Use XPATH? check box. This gets the documentId previously entered in the process data using XPath. See Get Doc ID (giveDocumentRequest function).
- Assign Document1 to documentKey in the Advanced Editor, select the Use XPATH? check box, and click OK.
The following illustration shows the BPML:
<operation name ="Add Document to Process Data">
<participant name="This"/>
<output message="takeDocumentRequest">
<assign to="documentKey" from="'Document1'"/>
<assign to="documentId" from="documentId/text()"/>
</output>
<input message="inmsg">
<assign to="." from="*"/>
</input>
</operation>
The document with the specified documentId is placed in process data in the Document1 node:
<Document1 SCIObjectID="L2000-000248:f96c:fae7d336aa:-7820"/>
Get Time Difference (takeDocumentRequest)
The Get Time Difference configuration of the This service takes two timestamps (a start time and an end time) as input and outputs the difference in milliseconds to process data.
- Select Allow message write from the Input Msg drop-down list and click Add.
- In the Advanced Editor, assign elapsedTimeMillis to diffTimestamp, select the Use XPATH? check box, and click OK.
- Select Messages Only from the Output Msg drop-down list.
- Set Message Name to timeDiffRequest and click Add.
- In the Advanced Editor, assign time1/currentTimeMillis/text() (the start time previously placed in process data) to startTimeMillis and select the Use XPATH? check box.
- Assign time2/currentTimeMillis/text() (the end time previously placed in process data) to endTimeMillis, select the Use XPATH? check box, and click OK.
The following illustration shows the BPML:
The elapsed time in milliseconds is placed in process data in the <diffTimestamp> tags:
<diffTimestamp>
<elapsedTimeMillis>1543</elapsedTimeMillis>
</diffTimestamp>
Release From Process Data (releaseRequest)
This releases the selected node (in this example the primary document) from process data.
- Select Allow Process Data Write from the Input Msg drop-down list.
- Select Messages Only from the Output Msg drop-down list.
- Set Message Name to releaseRequest and click Add.
- In the Advanced Editor, assign PrimaryDocument to from, select the Use XPATH? check box, and click OK.
The following illustration shows the BPML:
<operation name = "Release from Process Data">
<participant name="This"/>
<output message="releaseRequest">
<assign to="from" from="'PrimaryDocument'"/>
</output>
<input message="releaseResponse">
<assign to="." from="*"/>
</input>
</operation>
Process Data – Before Release
Before the This service is called, the process data contains the primary document in the PrimaryDocument node:
Process Data – After Release
After the This service has completed, the process data no longer contains the primary document: