Example of Business Process that Includes Begin/End Service

This example shows a business process that includes the Begin Transaction and the End Transaction service.

The following is an example of a business process that includes the Begin Transaction and End Transaction service.

Begin/End service example

Code Example - Business Process that Includes Begin/End Service


<process name="mStepJDBCService">
<sequence> 
<operation name="BP MetaData Info Service">
<participant name="BPMetaDataInfoService"/>
<output message="Xout">
<assign to="DISPOSITION">true</assign>
<assign to="LINKAGE">true</assign>
<assign to="CORRELATION">true</assign>
<assign to="TRACE">true</assign>
<assign to="." from="*"></assign>
</output>
<input message="Xin">
<assign to="." from="*"></assign>
</input>
</operation>

<operation name="LightweightJDBCAdapterType">
<participant name="LightweightJDBCAdapterQuery"/>
<output message="LightweightJDBCAdapterTypeInputMessage">
<assign to="sql">INSERT INTO WORKFLOW_DATA (WF_INSTANCE_ID,DATA_KEY,DATA
_NAME) VALUES (?, ?,?) </assign>
<assign to="param1" from="'-1'"></assign>
<assign to="paramtype1">Integer</assign>
<assign to="param2" from="'TestRollBack_7859'"></assign>
<assign to="paramtype2">String</assign>
<assign to="param3" from="'RollbackTest'"></assign>
<assign to="paramtype3">String</assign>
<assign to="pool">&DB_POOL;</assign>
<assign to="row_name">row</assign>
<assign to="query_type">ACTION</assign>
<assign to="result_name">result</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
</sequence> 
</process> 
here is the on with start|endtransaction service, service between star|endtransaction 
will share one transaction, i.e. if either one of lightweighjdbcservice, or 
sleepservice failed , none of then will be persisted. the rest of service will be in 
its own transaction. 
<process name="simpleCommitOnErrorTest_01">
<sequence> 
<operation name="Timestamp Utility">
<participant name="TimestampUtilService"/>
<output message="TimestampUtilServiceTypeInputMessage">
<assign to="action">current_time</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation> 
<operation name="BeginTransaction">
<participant name="BeginTransactionService"/>
<output message="Xout">
<assign to="START_TRANSACTION">TRUE</assign>
</output>
<input message="Xin">
<assign to="." from="*"></assign>
</input>
</operation> 
<operation name="LightweightJDBCAdapterType">
<participant name="LightweightJDBCAdapterQuery"/>
<output message="LightweightJDBCAdapterTypeInputMessage">
<assign to="sql">INSERT INTO WORKFLOW_DATA (WF_INSTANCE_ID,DATA_KEY,DATA
_NAME) VALUES (?, ?,?) </assign>
<assign to="param1" from="'-1'"></assign>
<assign to="paramtype1">Integer</assign>
<assign to="param2" from="'TestRollBack_7859'"></assign>
<assign to="paramtype2">String</assign>
<assign to="param3" from="'RollbackTest'"></assign>
<assign to="paramtype3">String</assign>
<assign to="pool">&DB_POOL;</assign>
<assign to="row_name">row</assign>
<assign to="query_type">ACTION</assign>
<assign to="result_name">result</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="Sleepy">
<participant name="EngineTestSleep"/>
<output message="Xout">
<assign to="SLEEP_INTERVAL">20</assign>
<assign to="." from="*"></assign>
</output>
<input message="Xin">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="EndTransaction">
<participant name="EndTransactionService"/>
<output message="Xout">
<assign to="END_TRANSACTION">TRUE</assign>
</output>
<input message="Xin">
<assign to="." from="*"></assign>
</input>
</operation> 
<operation name="Timestamp Utility">
<participant name="TimestampUtilService"/>
<output message="TimestampUtilServiceTypeInputMessage">
<assign to="action">current_time</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation> 
<operation name="BP MetaData Info Service">
<participant name="BPMetaDataInfoService"/>
<output message="Xout">
<assign to="DISPOSITION">true</assign>
<assign to="LINKAGE">true</assign>
<assign to="CORRELATION">true</assign>
<assign to="TRACE">true</assign>
<assign to="." from="*"></assign>
</output>
<input message="Xin">
<assign to="." from="*"></assign>
</input>
</operation> 
</sequence>
</process>