Input Message

Content that describes Input Message inside of business processes
admin's picture

Usage and real examples of Input Message options

Different options for Output Message determine priority of elements taken by a service, if it is element from Process Data or configuration parameter and the third option in which we tell to service to read only its configuration parameter and Process Data not at all.
 
Two options for Input Message only determine where the result will be written, into Process Data or Input Message.
 
Input Message is important to understand when you have 2 services in a BP where both of them produce the Primary Document as its result. That means, the second service will replace the Primary Document produced by the first service. After the second service executes, we have only one Primary Document, that is result of the second one. If we want to have both documents in Process Data, we have to place the Primary Document of the first service into Process Data under the name different than Primary Document and it will help us to retain the document in a business process.
 
Here is the example where we will show what happens when there are 2 different services where both produce Primary Document. The first service is FSA (File System Adapter) and another one is LWJDBC (Lightweight JDBC). In the end of a BP execution we can find only one Primary Document as the result of File System Adapter. Primary Document produced by LWJDBC is overwritten by the FSA:

Example 1 (Primary Document pulled from a DB by LWJDBC overriden by the document collected by FSA): 

<process name="default">

<sequence>

                   <operation name="Lightweight JDBC Adapter">
                             <participant name="LightweightJDBCAdapterQuery"/>
                             <output message="LightweightJDBCAdapterTypeInputMessage">
                                      <assign to="pool">mysqlPool</assign>
                                      <assign to="query_type">SELECT</assign>
                                      <assign to="result_name">result</assign>
                                      <assign to="row_name">row</assign>
                                      <assign to="sql">select * from SI_VERSION</assign>
                                      <assign to="." from="*"/>
                             </output>
                             <input message="inmsg">
                                      <assign to="." from="*"/>
                             </input>
                   </operation>
                   <operation name="File System Adapter">
                             <participant name="FSA_configurationName"/>
                             <output message="FileSystemInputMessage">
                                      <assign to="Action">FS_COLLECT</assign>
                                      <assign to="deleteAfterCollect">true</assign>
                                      <assign to="filter">fileNameFilter</assign>
                                      <assign to="." from="*"/>
                             </output>
                             <input message="inmsg">
                                      <assign to="." from="*"/>
                             </input>
                   </operation>
          </sequence>
</process>
 
To save a result of LWJDBC adapter in the Process Data under another name, we can use assign, to save the first document in a temp storage. You can see that in Example 2:

Example 2 (Primary Document saved under another element with separate assign statement): 

<process name="default">

          <sequence>
                   <operation name="Lightweight JDBC Adapter">
                             <participant name="LightweightJDBCAdapterQuery"/>
                             <output message="LightweightJDBCAdapterTypeInputMessage">
                                      <assign to="pool">mysqlPool</assign>
                                      <assign to="query_type">SELECT</assign>
                                      <assign to="result_name">result</assign>
                                      <assign to="row_name">row</assign>
                                      <assign to="sql">select * from SI_VERSION</assign>
                                      <assign to="." from="*"/>
                             </output>
                             <input message="inmsg">
                                      <assign to="." from="*"/>
                             </input>
                   </operation>
                  
                   <assign to="tempStorage" from="PrimaryDocument/@SCIObjectID"/>
                  
                   <operation name="File System Adapter">
                             <participant name="FSA_configurationName"/>
                             <output message="FileSystemInputMessage">
                                      <assign to="Action">FS_COLLECT</assign>
                                      <assign to="deleteAfterCollect">false</assign>
                                      <assign to="filter">fileNameFilter</assign>
                                      <assign to="." from="*"/>
                             </output>
                             <input message="inmsg">
                                      <assign to="." from="*"/>
                             </input>
                   </operation>
          </sequence>
</process>
 
In the end we can find 2 documents in the Process Data: 

<?xml version="1.0" encoding="UTF-8"?>

<ProcessData>
          <tempStorage SCIObjectID="serverName:49b61c40:11032a4d48e:5d0f"/>
          <FileName>fileName</FileName>
          <PrimaryDocument SCIObjectID="serverName:49b61c40:11032a4d48e:5d50"/>
</ProcessData>
 

If we want to avoid this additional step between LWJDBC Adapter and FSA for saving the result of LWJDBC into document named 'tempStorage', we can use assign in input message inside of LWJDBC. First of all, option for Input Message must be 'Allow message write' and additional assign must be added in input message (by Add option in GPM). You can see it in Example 3:

Example 3 (Primary Document saved under another element with assign statement inside of Input Message):

<process name="default">

          <sequence>
                   <operation name="Lightweight JDBC Adapter">
                             <participant name="LightweightJDBCAdapterQuery"/>
                             <output message="LightweightJDBCAdapterTypeInputMessage">
                                      <assign to="pool">mysqlPool</assign>
                                      <assign to="query_type">SELECT</assign>
                                      <assign to="result_name">result</assign>
                                      <assign to="row_name">row</assign>
                                      <assign to="sql">select * from SI_VERSION</assign>
                                      <assign to="." from="*"/>
                             </output>
                            
                             <input message="inmsg">
                                                <assign to="tempStorage" from="PrimaryDocument/@SCIObjectID"/>
                                    </input>
                            
                   </operation>
                   <operation name="File System Adapter">
                             <participant name="FSA_configurationName"/>
                             <output message="FileSystemInputMessage">
                                      <assign to="Action">FS_COLLECT</assign>
                                      <assign to="deleteAfterCollect">false</assign>
                                      <assign to="filter">fileNameFilter</assign>
                                      <assign to="." from="*"/>
                             </output>
                             <input message="inmsg">
                                      <assign to="." from="*"/>
                             </input>
                   </operation>
          </sequence>
</process>

The first step was switch to 'Allow message write' so we can get result of service into input message insted of in the Process Data. As we have input message at disposal, we can use assign in the input message that takes values/nodes from Input Message and put it into Process Data. The assign statement from the example...

<assign to="tempStorage" from="PrimaryDocument/@SCIObjectID"></assign>

 ...will take content of the Primary Document and put it into document named 'tempStorage' 

Using assign inside of input message gives the same result in Process Data as independant assign in the Example 2:

<?xml version="1.0" encoding="UTF-8"?>

<ProcessData>
          <tempStorage SCIObjectID="serverName:49b61c40:11032a4d48e:5d0f"/>
          <FileName>fileName</FileName>
          <PrimaryDocument SCIObjectID="serverName:49b61c40:11032a4d48e:5d50"/>
</ProcessData>  

Since the result of LWJDBC Adapter is always in XML format, we can use another assign to get XML tree in Process Data: 

Example 4 (Primary Document content moved directly to Process Data by DocToDOM function ): 

 <process name="default">

          <sequence>
                   <operation name="Lightweight JDBC Adapter">
                             <participant name="LightweightJDBCAdapterQuery"/>
                             <output message="LightweightJDBCAdapterTypeInputMessage">
                                      <assign to="pool">mysqlPool</assign>
                                      <assign to="query_type">SELECT</assign>
                                      <assign to="result_name">result</assign>
                                      <assign to="row_name">row</assign>
                                      <assign to="sql">select * from SI_VERSION</assign>
                                      <assign to="." from="*"/>
                             </output>
 
                             <input message="inmsg">
                                                <assign to="tempStorage" from="DocToDOM(PrimaryDocument)"/>
                                    </input>
 
                   </operation>
                   <operation name="File System Adapter">
                             <participant name="FSA_configurationName"/>
                             <output message="FileSystemInputMessage">
                                      <assign to="Action">FS_COLLECT</assign>
                                      <assign to="deleteAfterCollect">false</assign>
                                      <assign to="filter">fileNameFilter</assign>
                                      <assign to="." from="*"/>
                             </output>
                             <input message="inmsg">
                                      <assign to="." from="*"/>
                             </input>
                   </operation>
          </sequence>
</process>

Process Data after this business process will contain the result of LWJDBC in Process Data tree and Primary Document as the result of FSA: 

<?xml version="1.0" encoding="UTF-8"?>

<ProcessData>
          <tempStorage>
                   <result>
                             <row>
                                      <SI_VERSION>4.1.0-1976</SI_VERSION>
                                      <SI_INSTALL_DATE>2007-01-15 11:30:49</SI_INSTALL_DATE>
                                      <SI_COMMENTS>SI patch installation</SI_COMMENTS>
                                      <PRODUCT_VERSION>4.1.1</PRODUCT_VERSION>
                                      <ENGINE_VERSION>1976</ENGINE_VERSION>
                             </row>
                   </result>
          </tempStorage>
          <FileName>mimi</FileName>
          <PrimaryDocument SCIObjectID="serverName:49b61c40:11032a4d48e:6646"/>
</ProcessData>
 

 

admin's picture

Two different options in Input Message

There are 2 different options for Input Message:
 
Allow Process Data write
 
If you use option 'Allow Process Data write' for an Input Message in a service, the result of service execution will be placed in the Process Data.
How it looks like in bpml code:
 
 <operation name="File System Adapter">
          <participant name="PLIVA_FSA"/>
          <output message="FileSystemInputMessage">
                   <assign to="Action">FS_COLLECT</assign>
                   <assign to="deleteAfterCollect">false</assign>
                   <assign to="filter">mimi</assign>
                   <assign to="." from="*"/>
          </output>
          <input message="inmsg">
                        <assign to="." from="*"/>
            </input>
</operation>
 
 
Allow message write
 
If you use option 'Allow message write' for an Input Message in a service, the result of service execution will be placed into the input message.
 
Input message for this option in bpml looks as follows:
 
<operation name="File System Adapter">
          <participant name="PLIVA_FSA"/>
          <output message="FileSystemInputMessage">
                   <assign to="Action">FS_COLLECT</assign>
                   <assign to="deleteAfterCollect">false</assign>
                   <assign to="filter">mimi</assign>
                   <assign to="." from="*"/>
          </output>
          <input message="inmsg">
      </input>
</operation>
 
When you start the process and want to see an Input Message for a certain service, go into Process Monitor, find your process, open it, click on info of Instance data for the service which Input Message you want to see and finally click on 'Message From Service' link on the left side will show you input message sent from the service to the business process.
 
  • For Get Document Information Service input message looks like this:
 
<?xml version="1.0" encoding="UTF-8"?>
<inmsg>
          <BodyName>bodyName</BodyName>
          <BodyLength>1076</BodyLength>
          <DocumentBodyLength>1076</DocumentBodyLength>
          <DocumentName>documentName</DocumentName>
          <DocumentId>serverName:49b61c40:11032a4d48e:3b0b</DocumentId>
          <DocumentSubject/>
          <DocumentCreateTime/>
          <DocumentLength>1076</DocumentLength>
          <DocumentLifeSpan>0 Minutes</DocumentLifeSpan>
          <DocumentInitialId>madrugada:49b61c40:11032a4d48e:3b0b</DocumentInitialId>
          <DocumentMaxInlineBodySize>102400</DocumentMaxInlineBodySize>
          <DocumentPurgeAfter>2007-01-18 12:21:23.93</DocumentPurgeAfter>
          <DocumentStorageType>DATABASE</DocumentStorageType>
          <DocumentWorkflowId>200152</DocumentWorkflowId>
          <DocumentType>0</DocumentType>
</inmsg>
 
It is the result of Get Document Information service that goes into Process Data with option 'Allow Process Data write', but when you choose option 'Allow Message write' it is not placed in the Process Data, but into Input Message or Message From Service as shown above.
 
  • For File System Adapter in collection mode, its result is FileName and Primary Document, Input Message looks like as follows:
 
<?xml version="1.0" encoding="UTF-8"?>
<inmsg>
          <FileName>fileName</FileName>
          <PrimaryDocument SCIObjectID="serverName:49b61c40:11032a4d48e:3b53"/>
</inmsg>
 
Remember that the rest of services in your BP will not be able to get any information that is redirected into Input Message. Input message content retains only for the current service, but not for the whole process.
The Process Data is accumulation area that lives from the beginning of the process to the end.
Input message is accesible just by a service that executes an activity and produce that message, and you can take some elements that you will need later, by assign(s) inside of the input message and put it into Process Data for later use.  

 

admin's picture

Content of Input Message

Example of Input Message from Get Document Information Service to business process or Process Data (it is only a part of full XML inpu message, so not well formed):

 
          <BodyName>bodyName</BodyName>
          <BodyLength>1076</BodyLength>
          <DocumentBodyLength>1076</DocumentBodyLength>
          <DocumentName>documentName</DocumentName>
          <DocumentId> serverName:49b61c40:1102f7e087e:-15ad</DocumentId>
          <DocumentSubject/>
          <DocumentCreateTime/>
          <DocumentLength>1076</DocumentLength>
          <DocumentLifeSpan>0 Minutes</DocumentLifeSpan>
          <DocumentInitialId>serverName:49b61c40:1102f7e087e:-15ad</DocumentInitialId>
          <DocumentMaxInlineBodySize>102400</DocumentMaxInlineBodySize>
          <DocumentPurgeAfter>2007-01-17 15:52:32.474</DocumentPurgeAfter>
          <DocumentStorageType>DATABASE</DocumentStorageType>
          <DocumentWorkflowId>198318</DocumentWorkflowId>
          <DocumentType>0</DocumentType>
 
Example of File System Adapter Input Message:
 
<PrimaryDocument SCIObjectID="serverName:49b61c40:1102f7e087e:-1565"/>
 
admin's picture

Input Message

Input Message in bpml, is message in XML format sent from a service to a business bprocess as an incoming message.
 
Result of a service execution is XML sent to a business process as an Input Message.

admin's picture

Assign activities

There are three different assign activites. Assign in an input message, assign in an output message and independant assign that is out of messages.

 
Here is an example of part of bpml code where we can see assign activities in all 3 different areas:
 
<operation name="HTTP Client End Session Service">
      <participant name="HTTPClientEndSession"/>
      <output message="HTTPClientEndSessionServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="SessionToken" from="SessionToken/text()"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
</operation>
 
<assign to="variable1">value1</assign>
 
 
Assign in an Input Message
 
Assign defined inside of input message takes value(s)/node(s) from incoming message (message from service) and put the result into Process Data. Source for assign in an input message is message that is the result of service and target is Process Data. 
 
<input message="inmsg">
        <assign to="." from="*"></assign>
</input>
 
Assign in an Output Message
 
Assign defined inside of output message takes value(s)/node(s) from Process Data and place it into outgoing message (message to service). Source for assign in an output message is Process Data and target is XML message that will be sent to a service.
 
<output message="HTTPClientEndSessionServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="SessionToken" from="SessionToken/text()"></assign>
</output>
 
Independant Assign – Assign element
 
For assign activity defined outside of messages, source from which the value(s)/node(s) will be taken is Process Data and place where it will be put is also Process Data. So the source and target destination for independant assign is Process Data.
 
<assign to="variable1">value1</assign>
 
admin's picture

Input/Output Message in bpml

While creating the business processes and run them in Sterling Integrator you can work without knowing what input and output messages are, what their roles are, what problems input or output message can cause and how you can obtain your aim easier by using input message.
But it is important to know what messages are, how they are used by services and business processes.
 
They are also useful for better understanding principal how business process and services interacts to each other, writing processes that will execute faster and also for debugging processes easier.
 
We know that it is more efficient to write specified Xpath than use searching through all the XML in the Process Data by '//' addressing. If understand Output Message we can see that service can read only its own configuration parameters instead of both Process Data and its configuration parameters. If we decide to give services parameters from configuration and Process Data, we can determine priority between them.   
 
Although definitions will not be enough to understand meaning and role of input/output messages, I will write them first and after that explain them on examples and real situations.
 
A business process is a set of activities, includes services and adapters or simple bpml activities, and inside of BP, interaction between business process and services/adapters is obtained by exchanging input and output messages.
 
Every business process works on principal of exchanging messages between business process context or Process Data and services. So every service in a business process, that acts as one activity, receives XML message from business process - it is Output message, and the result of service, after its execution, is also sent as XML message back to a business process – it is Input Message.
 
Short explanation for types of message:
 
Output Message – XML message from a business process to a service/adapter
Input Message – XML message from a service/adapter to a business process
 

Syndicate content