OFTP flow and test processing in SI
1. Main steps for starting with OFTP:
· Configure OdetteFTP Adapter
· Create OFTP Profile
o Physical Partner - LOCAL
o Physical Partner – REMOTE
o Logical Partner – ORIGINATOR
o Logical Partner - DESTINATION
o Physical Partner Contract
o Logical Partner Contract
· Create/modify template process for adding a FILE/EERP/NERP to OFTP table in database (oftpfile/oftpeerp/oftpnerp), by OFTPQueue Handler Service.
· Create and run/schedule the process that will check if there is anything to send, by comparing PPC (Physical Partner Contract) initiate OFTP communication. That can be oftpcheckmessages BP, with OFTPScheduler Adapter.
· Create/modify template process for initiating OFTP communication between partners. That BP name is written in Initiator Business Process Name parameter of PPC, and oftpinitsession can be used.
2. Profile creation
Physical Partner - PartnerA:
Physical Partner - PartnerB:
PPC:
Logical Partner – L_PartnerA:
Logical Partner – L_PartnerB:
LPC:
3. OFTP in SI - diagram
Note: A part II can be skipped, as we can put the file in OFTP storage as shown in a part I, and run it manually as shown in the part III. The whole flow is for automatic procedure.
Explanation of all the steps from diagram:
· BPML code:
<process name="myOftpfile">
<sequence name="send">
<assign to="LogicalPartnerContract" from="'LPC_PartnerA_PartnerB'"/>
<assign to="filename">dataitem1.dat</assign>
<assign to="Date">060825</assign>
<assign to="Time">153055</assign>
<operation name="CreateFILEStructure">
<participant name="AssignService"/>
<output message="DataItemOut">
<assign to="OFTPDataItem/FILE/document" from="PrimaryDocument"/>
<assign to="OFTPDataItem/FILE/properties/LogicalPartnerContract" from="LogicalPartnerContract/text()"/>
<assign to="OFTPDataItem/FILE/properties/OFTPVirtualFilename" from="filename/text()"/>
<assign to="OFTPDataItem/FILE/properties/Date" from="Date/text()"/>
<assign to="OFTPDataItem/FILE/properties/Time" from="Time/text()"/>
<assign to="OFTPDataItem/FILE/properties/FileFormat" from="FileFormat/text()"/>
<assign to="." from="*"/>
</output>
<input message="toProcessData">
<assign to="." from="*"/>
</input>
</operation>
<!-- Queue document for OFTP send process -->
<operation name="QueueFile">
<participant name="OFTPQueueHandler"/>
<output message="OFTPOut">
<assign to="." from="*"/>
</output>
<input message="OFTPIn">
<assign to="." from="*"/>
</input>
</operation>
</sequence>
</process>
- Process Data after OFTPQueueHandler:
<?xml version="1.0" encoding="UTF-8"?>
<ProcessData>
<PrimaryDocument SCIObjectID="MIRJANA:node1:12f4dbd1146:26471"/>
<LogicalPartnerContract>LPC_PartnerA_PartnerB</LogicalPartnerContract>
<filename>dataitem1.dat</filename>
<Date>060825</Date>
<Time>153055</Time>
<OFTPDataItem>
<FILE>
<document>
<PrimaryDocument SCIObjectID="MIRJANA:node1:12f4dbd1146:26471"/>
</document>
<properties>
<LogicalPartnerContract>LPC_PartnerA_PartnerB</LogicalPartnerContract>
<OFTPVirtualFilename>dataitem1.dat</OFTPVirtualFilename>
<Date>060825</Date>
<Time>153055</Time>
</properties>
</FILE>
</OFTPDataItem>
</ProcessData>
Record written to a database (OFTP_OBJECT & OFTP_OBJECT_EXT)
<?xml version="1.0" encoding="UTF-8"?>
<ROWSET>
<ROW>
<EVENT_ID>3</EVENT_ID>
<TYPE>FILE</TYPE>
<STATUS>SCHEDULED</STATUS>
<WFC_ID>MIRJANA:node1:12f4859ecf9:264726</WFC_ID>
<MESSAGE_ID>0</MESSAGE_ID>
<DOCUMENT_ID>MIRJANA:node1:12f4859ecf9:264681</DOCUMENT_ID>
<LPC>LPC_PartnerA_PartnerB</LPC>
<PPC>PPC_PartnerB_PartnerA</PPC>
<SFIDDSN>dataitem1.dat</SFIDDSN>
<SFIDDATE_TIME>2006-08-25 15:30:55.0</SFIDDATE_TIME>
<SFIDTIMEC>2</SFIDTIMEC>
<SFIDUSER/>
<SFIDDEST>admin</SFIDDEST>
<SFIDORIG>mirjana</SFIDORIG>
<NERPCREA>null</NERPCREA>
<SFIDFMT>T</SFIDFMT>
<SFIDLRECL>0</SFIDLRECL>
<SFIDFSIZ>21504</SFIDFSIZ>
<SFIDREST>0</SFIDREST>
<NERPREAS>null</NERPREAS>
<DELIMITERS>-01-01</DELIMITERS>
<RETRY_COUNT>0</RETRY_COUNT>
<CREATE_TIME>2011-04-12 12:48:48.0</CREATE_TIME>
<UPDATE_TIME>2011-04-12 12:48:48.0</UPDATE_TIME>
<RETRY_TIME>null</RETRY_TIME>
<OBJECT_LOCK>U</OBJECT_LOCK>
<EXTENSION_POINT>301989888</EXTENSION_POINT>
</ROW>
</ROWSET>
Run manually or schedule oftpcheckmessages
Run it manually (normally should be scheduled)
Provide OFTPPPCName to OdetteFTP Scheduler Adapter in oftpcheckmessages
· BPML code:
<process name="oftpcheckformessages">
<sequence name="check">
<assign to="OFTPPPCName">PPC_PartnerA_PartnerB</assign>
<operation name="CheckForOFTPMessages">
<participant name="OFTPScheduler"/>
<output message="DataSetOut">
<assign to="." from="*"/>
</output>
<input message="toProcessData">
<assign to="." from="*"/>
</input>
</operation>
</sequence>
</process>
Matching PPC with database
If there is match between PPC (OFTPPPCName) and PPCs in a database, then Initiator Business Process (oftpinitsession) is run by OFTPScheduler.
If OFTPActionType in OdetteFTPScheduler Adapter is Conditional, Initiator BP will be run only if there is match between PPCs, but if it is Uncoditional, Initiator BP will be run regardless of matching PPCs.
oftpinitsession
· BPML code:
<process name="oftpinitsession">
<sequence name="oftp">
<!-- Start OFTP send process in Mailbox Mode-->
<operation name="SendOFTP">
<participant name="myOdetteFTP"/>
<output message="Out">
<assign to="." from="*"/>
</output>
<input message="In">
<assign to="." from="*"/>
</input>
</operation>
</sequence>
</process>
- Process Data transferred to OdetteFTPAdapter (myOdetteFTP) is:
<?xml version="1.0" encoding="UTF-8"?>
<ProcessData>
<PhysicalPartnerContract>PPC_PArtnerA_PartnerB</PhysicalPartnerContract>
</ProcessData>
Note:with preconfigured OdetteFTPAdapter configuration (i.e. OFTPSendFile), oftpinitsession cannot be run, although there is match between PPC given to OdetteFTPScheduler Adapter and database. When I create custom configuration of OdetteFTP Adapter (myOdetteFTP), it started to work!!!
oftpin
· BPML code:
<process name="oftpin">
<rule name="is-FILE">
<condition>
( OFTPInbound/Type/text() = 'File')
</condition>
</rule>
<rule name="is-EERP">
<condition>
( OFTPInbound/Type/text() = 'EERP')
</condition>
</rule>
<rule name="is-NERP">
<condition>
( OFTPInbound/Type/text() = 'NERP')
</condition>
</rule>
<sequence name="receive">
<!-- Check type of inbound -->
<choice name="Choice Start">
<select>
<case ref="is-FILE" activity="processFILE"/>
<case ref="is-EERP" activity="processEERP"/>
<case ref="is-NERP" activity="processNERP"/>
</select>
<sequence name="processFILE">
<!-- Add your business logic for processing inbound files, e.g. call EDIDeenvelope -->
<operation>
<participant name="EDIDeenvelope"/>
<output message="ediout">
<assign to="." from="*"/>
</output>
<input message="ediin"/>
</operation>
</sequence>
<sequence name="processEERP">
<!-- Add your business logic for processing inbound EERPs -->
<assign to="key" from="concat(OFTPInbound/FileName/text(),
OFTPInbound/Date/text(),
OFTPInbound/Time/text())"/>
<assign to="status" from="'SUCCESS'"/>
</sequence>
<sequence name="processNERP">
<!-- Add your business logic for processing inbound NERPs -->
<assign to="key" from="concat(OFTPInbound/FileName/text(),
OFTPInbound/Date/text(),
OFTPInbound/Time/text())"/>
<assign to="status" from="'ERROR'"/>
</sequence>
</choice>
</sequence>
</process>
- Process Data after oftpin:
<?xml version="1.0" encoding="UTF-8"?>
<ProcessData>
<PrimaryDocument SCIObjectID="MIRJANA:node1:12f4dbd1146:11419"/>
<OFTPInbound>
<FileName>dataitem1.dat</FileName>
<Type>File</Type>
<FileSize>266</FileSize>
<Destination>admin</Destination>
<Time>1530550001</Time>
<Originator>mirjana</Originator>
<Date>20060825</Date>
<FileFormat>T</FileFormat>
</OFTPInbound>
</ProcessData>