Friday, 11 November 2016

Scneario: Whenever file is being placed in mailbox routing rull.It has to call one business process that will take the mailbox path as input and using jdbc adapter (In code list sender id is mailbox path and text1 is map name) it will get the map name. Using the Translate function it will call the map and translate it .

<process name="default">
<rule name="looping">
<condition>number(countMsgID/text())&gt;=number(//loop_counter/text())</condition>
</rule>

<sequence name="Main_Seq">
<assign name="Assign" to="loop_counter">1</assign>
<assign name="Assign" to="countMsgID" from="count(//RoutingRequest/MessageId)"></assign>
<sequence name="Start Loop">
<choice name="Choice_start">
<select>
<case ref="looping" activity="loopStart"/>
</select>

<sequence name="loopStart">
<operation name="Mailbox Extract Begin Service">
<participant name="MailboxExtractBegin"/>
<output message="MailboxExtractBeginServiceTypeInputMessage">
<assign to="." from="*"></assign>
<assign to="CommitNow">YES</assign>
<assign to="MessageId" from="/ProcessData/RoutingRequest/RoutingRequest/MessageId/text()[position()=//loop_counter/text()]"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>

<operation name="Invoke Sub-Process">
<participant name="InvokeSubProcessService"/>
<output message="InvokeSubProcessServiceTypeInputMessage">
<assign to="." from="*"></assign>
<assign to="INVOKE_MODE">ASYNC</assign>
<assign to="WFD_NAME">MyBootStrapProcess</assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>

<assign name="Assign" to="loop_counter" from="number(loop_counter/text())+1"></assign>
<repeat name="Repeat" ref="Start Loop"/>

</sequence>
</choice>
</sequence>
</sequence>
</process>



Sub-Process:


<process name="default">
<sequence name="Sequence Start">
<assign name="Assign" to="OrigPrimaryDoc" from="PrimaryDocument/@SCIObjectID"></assign>
<operation name="Lightweight JDBC Adapter">
<participant name="LightweightJDBCAdapterQuery"/>
<output message="LightweightJDBCAdapterTypeInputMessage">
<assign to="." from="*"></assign>
<assign to="param1">Code_List_Murali</assign>
<assign to="param2" from="/ProcessData/MailboxPath/text()"></assign>
<assign to="paramtype1">String</assign>
<assign to="paramtype2">String</assign>
<assign to="pool">db2Pool</assign>
<assign to="query_type">SELECT</assign>
<assign to="result_name">result</assign>
<assign to="row_name">xref</assign>
<assign to="sql">select TEXT1 from CODELIST_XREF_ITEM a, CODELIST_XREF_VERS b where a.LIST_VERSION = b.DEFAULT_VERSION and a.LIST_NAME=? and a.LIST_NAME=b.LIST_NAME and a.SENDER_ITEM =?</assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>

<assign name="Assign" to="." from="DocToDOM(PrimaryDocument)"></assign>
<assign name="Assign" to="PrimaryDocument" from="OrigPrimaryDoc/@SCIObjectID"></assign>
<operation name="Translation">
<participant name="Translation"/>
<output message="TranslationTypeInputMessage">
<assign to="." from="*"></assign>
<assign to="map_name" from="/ProcessData/result/xref/TEXT1/text()"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>

</sequence>
</process>

FTP for collecting Mutliple files Sterling Integrator








<process name="default">
  <rule name="count">
    <condition>number(//x/text())&lt;= number(//y/text())</condition>
  </rule>

  <sequence name="Sequence Start">
    <operation name="FTP Client Begin Session Service">
      <participant name="FTPClientBeginSession"/>
      <output message="FTPClientBeginSessionServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="FTPClientAdapter">FTPClientAdapter</assign>
        <assign to="RemoteHost">172.17.15.47</assign>
        <assign to="RemotePasswd">murali</assign>
        <assign to="RemotePort">8114</assign>
        <assign to="RemoteUserId">murali</assign>
        <assign to="UsingRevealedPasswd">true</assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

    <operation name="FTP Client GET Service">
      <participant name="FTPClientGet"/>
      <output message="FTPClientGetServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="RemoteFilePattern">*.*</assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

    <operation name="FTP Client LIST Service">
      <participant name="FTPClientList"/>
      <output message="FTPClientListServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="ConnectionType">PASSIVE</assign>
        <assign to="NamesOnly">YES</assign>
        <assign to="SessionToken" from="/ProcessData/SessionToken/text()"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

    <assign name="Assign" to="x">1</assign>
    <assign name="Assign" to="y" from="count(//Name)"></assign>
    <choice name="loop_start">
      <select>
        <case ref="count" activity="seq_start"/>
      </select>

      <sequence name="seq_start">
        <assign name="Assign" to="PrimaryDocument" from="//*[starts-with(name(),string(/ProcessData/ListNames/Name[position()=//x/text()]/text()))]/@SCIObjectID"></assign>
        <operation name="File System Adapter">
          <participant name="E5FileSystem"/>
          <output message="FileSystemInputMessage">
            <assign to="." from="*"></assign>
            <assign to="Action">FS_EXTRACT</assign>
            <assign to="bootstrap">false</assign>
            <assign to="extractionFolder">C:\Miracle\Murali\extraction</assign>
          </output>
          <input message="inmsg">
            <assign to="." from="*"></assign>
          </input>
        </operation>

        <assign name="Assign" to="x" from="//x/text()+1"></assign>
        <repeat name="Repeat" ref="loop_start"/>

      </sequence>
    </choice>
    <operation name="FTP Client End Session Service">
      <participant name="FTPClientEndSession"/>
      <output message="FTPClientEndSessionServiceTypeInputMessage">
        <assign to="." from="*"></assign>
        <assign to="SessionToken" from="/ProcessData/SessionToken/text()"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

  </sequence>
</process>