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.

The This service is a multi-purpose utility service with the following functions:
  • 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:
  • Business process definition ID
  • Persistence level
  • Lifespan
  • Business process definition version
  • Sub/parent business process information
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:
  • Document Name
  • Document Body Length
  • Document ID
  • Document Subject
  • Document Create Time
  • Document Content Type
  • Document Char Encoding
  • Document Content Subtype
  • Previous Document ID
  • Document Length
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:
  • Create a timestamp for the current time.
  • Add the numeric values of two timestamps.
  • Subtract one timestamp value from another.
  • Format timestamp values.

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:
  • Obtain the ID of the current business process.
  • Obtain document metadata (name, document ID) for future use in the business process.
  • Load a document or information into process data.
  • Release a node from process data.
  • Make an assignment to process data.
  • Obtain a timestamp on the process.
  • Obtain the elapsed time between a start time and a finish time.
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:
  • Release Service
  • TimeStamp Utility Service
  • Get Document Info Service
  • BP MetaData Info Service
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:
  • Success
  • Failure
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:
  • True – The value for the duplicate tag in process data is replaced.
  • False – A new entry for the duplicate tag is added to process data. Default.
Trim whitespace flag (trimWhitespace) Delete whitespace before the assignment is made. Optional. Valid values are:
  • True – Any whitespace in the assignment to process data is deleted.
  • False – No whitespace is deleted. Default.
Time Format syntax (format) The syntax to format a millisecond timestamp. The standard 1.3.1 Java object SimpleDate format is used to define the syntax (see Javadoc http://www.java.sun.com/j2se/1.3.1/docs/api/index.htm 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:
  • True – UTC
  • False – GMT (Default)
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">).

The following message types are supported:
  • 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.

This business process does the following:
  1. Gets the current (start) time and assigns it to tag <time1> in process data.
  2. Gets the current time and formats it in process data.
  3. Gets the document ID of the primary document and places it in process data.
  4. Gets the business process ID and places it in process data.
  5. Gets the name of the primary document and places it in process data.
  6. Takes the primary document, assigns it to Document1 and makes a reference to it available in process data.
  7. Gets the current time and assigns it to tag <time2> in process data.
  8. Gets the time difference in milliseconds between time2 and time1 and assigns it to a variable in process data.
  9. Releases the primary document from process data.

This is the business process as shown in the GPM:

Usage Examples

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.

Note: All GPM parameters are assigned using either the Advanced Editor for the Message From Service tab or the Add button for the Message To Service tab.

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.

Set the following parameters in the GPM Message From Service tab:
  1. Select Allow message write from the Input Msg drop-down list and click Add.
  2. In the Advanced Editor, assign * (asterisk) to time1, select the Use XPATH? check box, and click OK.

    Get Start Time and Get End Time (timeRequest function)

Set the following parameters in the GPM Message To Service tab:
  1. Select Messages Only from the Output Msg drop-down list.
  2. Set Message Name to timeRequest.

    Get Start Time and Get End Time (timeRequest function)

The following illustration shows the BPML:

Get Start Time and Get End Time (timeRequest function)

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.

Note: For more information about the SimpleDateFormat, see http://www.java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html.
Set the following parameters in the GPM Message To Service tab:
  1. Select Messages Only from the Output Message drop-down list.
  2. Set Message Name to timeRequest and click Add.
  3. In the Advanced Editor, assign yyyy-MM-dd:HH:mm:ss to format and click OK.

    Format Time (timeRequest function)

Set the following parameters in the GPM Message From Service tab:
  1. Select Allow message write from the Input Msg drop-down list and click Add.
  2. In the Advanced Editor, assign * (asterisk) to time1 and click OK.

The following illustration shows the BPML:

Format Time (timeRequest function)

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.

Set following parameter in the GPM Message From Service tab:
  • Select Allow Process Data write from the Input Msg drop-down list.

    Get Doc ID (giveDocumentRequest function)

Set the following parameters in the GPM Message To Service tab:
  1. Select Obtain process Data first, then Messages from the Output Msg drop-down list.
  2. Set Message Name to giveDocumentRequest and click Add.
  3. In the Advanced Editor, assign PrimaryDocument to documentKey, select the Use XPATH? check box, and click OK.

    Get Doc ID (giveDocumentRequest function)

The following illustration shows the BPML:

Get Doc ID (giveDocumentRequest function)

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.

Set the following parameters in the GPM Message From Service tab:
  1. Select Allow message write from the Input Msg drop-down list and click Add.
  2. In the Advanced Editor, assign this/node() to thisProcessInstance, select the Use XPATH? check box, and click OK.

    Get Business Process ID (thisRequest function)

Set the following parameters in the GPM Message To Service tab:
  1. Select Messages only from the Output Msg drop-down list.
  2. Set Message Name to thisRequest.

    Get Business Process ID (thisRequest function)

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.

Set the following parameter in the GPM Message From Service tab:
  • Select Allow Process Data write from the Input Msg drop-down list.

    Get Document Name (getDocumentName)

Set the following parameters in the GPM Message To Service tab:
  1. Set Message Name to getDocumentName.
  2. Select Obtain Process Data first, then Messages from the Output Msg drop-down list and click Add.
  3. In the Advanced Editor, assign PrimaryDocument to documentName, select the Use XPATH? check box, and click OK.

    Get Document Name (getDocumentName)

The following illustration shows the BPML:

Get Document Name (getDocumentName)

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.

Set the following parameter in the GPM Message From Service tab:
  • Select Allow Process Data write from the Input Message drop-down list.

    Add Document to Process Data (takeDocumentRequest)

Set the following parameters in the GPM Message To Service tab:
  1. Set Message Name to takeDocumentRequest.
  2. Select Messages Only from the Output Msg drop-down list and click Add.
  3. 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).
  4. Assign Document1 to documentKey in the Advanced Editor, select the Use XPATH? check box, and click OK.

    Add Document to Process Data (takeDocumentRequest)

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.

Set the following parameters in the GPM Message From Service tab:
  1. Select Allow message write from the Input Msg drop-down list and click Add.
  2. In the Advanced Editor, assign elapsedTimeMillis to diffTimestamp, select the Use XPATH? check box, and click OK.

    Get Time Difference (takeDocumentRequest)

Set the following parameters in the GPM Message To Service tab:
  1. Select Messages Only from the Output Msg drop-down list.
  2. Set Message Name to timeDiffRequest and click Add.
  3. 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.
  4. Assign time2/currentTimeMillis/text() (the end time previously placed in process data) to endTimeMillis, select the Use XPATH? check box, and click OK.

    Get Time Difference (takeDocumentRequest)

The following illustration shows the BPML:

Get Time Difference (takeDocumentRequest)

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.

Set the following parameter in the GPM Message From Service tab:
  • Select Allow Process Data Write from the Input Msg drop-down list.

    Release From Process Data (releaseRequest)

Set the following parameters in the GPM Message To Service tab:
  1. Select Messages Only from the Output Msg drop-down list.
  2. Set Message Name to releaseRequest and click Add.
  3. In the Advanced Editor, assign PrimaryDocument to from, select the Use XPATH? check box, and click OK.

    Release From Process Data (releaseRequest)

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:

Release From Process Data (releaseRequest)

Process Data – After Release

After the This service has completed, the process data no longer contains the primary document:

Release From Process Data (releaseRequest)