Generic Inbound Business Process with Email Notification - IBM Sterling Integrator



Step By Step Procedure To Create A Generic Inbound Process In IBM Sterling Integrator

Purpose:


Creating a Business Process using Graphical Process Modeler to send an Email Error Notification to mail, if there are any errors occurred while executing an Inbound Map.


INBOUND PROCESS: 

The process of converting standard format to application format.

Steps to Follow:

1) Creating an inbound Map.
2) Verify of source and target Structure.
3) Cross verification whether it is a simple, standard or extended link.
4) Based on instruction provided in FMD (Functional Mapping
       Documentation) and Looping. We provide Simple links, standard rules
       and extended rules.
  5) Saving the map and compiling and it will generate a .txo file.
  6) Selecting the Map test.
  7) Get the output of the particular map.
  8) We create a BP of inbound using the services.
  9) The services involved in inbound BP are FileSystemAdapter.
10)We configure the following services and save them.
  11) We create the process of the BP and select the BP which is created
         before.
12) Create the envelopes of ISA,GS,ST of the inbound map and then we
             will run the process of the BP.
13) Get the output of the particular BP


Deploying Map:

  1. Open Sterling Integrator and Select Deployment tab.                  
  2. In that Deployment tab click on the maps.
  3. Click on the “Check in new map from Map Editor” to deploy a new map.
  4. Browse the .map and .txo files 
  5. Then click next.
  6. Now, just click on the  Finish. Then the map will be deployed into SI


Screen shots shown below:


SI Inbound Process



SI Inbound Process-1




SI Inbound Process-2


 Now we are creating  BP(Business Process) for the INBOUND Process:

             1.For Deenveloping              
            
             2.For collecting the file and Email Notification 
            
             3.For Extraction 

Before creating we should know the use of service and adapters what we are using.

We have to create BP's by GPM(Graphical Process Model) using BPML(Business Process Manipulation language)  activities . 
                        
BPML: 

Business Process Modeling Language (BPML) is an XML-based language used to describe (model) and run business processes. Each business process is defined by a single, unique BPML document known as a business process model (.bpml or .bp file). Each business process model is the definition of the process as it will be run in Sterling Integrator. This topic explains the basic components of BPML that make up your business process models so that you can identify the components in your day-to-day interaction with Sterling Integrator operations.

X12 Deenvelope: 

It Handles deenveloping of inbound X12 interchanges. It does compliance checking (except for sequence checking). It also generates 997 and TA1 acknowledgments, and reconciles inbound 997 acknowledgments, if no sequence checking is required.

Usage Example:

An inbound purchase order is received inside an X12 interchange. The EDI envelopes are parsed and the document envelopes that match the envelope data are retrieved. With the document envelopes, this service knows what to do with the purchase order, such as kicking off a business process to perform some business logic.

File System Adapter: 

Collects (imports) files from the file system and extracts (exports) files to the file system. The collected file becomes the primary document in a business process for file collection. A primary document is input to the File System adapter for file extraction.

OnFault Group:

The onFault element is used to handle errors. You can include onFault elements in any complex activity for which it may be necessary to recover from faults so that the process can continue. The onFault element contains a fault handling activity. 

Assign: 

The assign element is a BPML construct you can use to perform simple assignment operations within a service call. You can also use assign statements outside of any operation, input, or output tags. Sometimes called top-level assignment, this method enables you to manipulate the process data directly, outside the service call in a process rather than within the service step. 

XML Encoder: 

It Translates the primary document into XML using a specified map, replacing the primary document with the result of the translation. The XML Encoder service is used within business processes to translate of the primary document into XML. 

Configuring XML ENCODER SERVICE: 
   
The  XML Encoder Service is used with in the business process to translate primary document into the XML.

• mode: Whether translation is performed on an input file, if the input file is already in the XML format then the file can be imported directly attached to the process data.
•Encode Non-XML document.
•Using existing XML document
•Create document using Xpath.
•root-element:This field is mandatory. Root element name of the document containing result of Xpath expression.
•Xpath: When value in mode field is process_data_to_document then the value is a string.


SMTP Send Adapter:

The Sterling Integrator SMTP Send adapter allows documents to be sent to any valid e-mail address by using an accessible mail server (usually of the trading partner that is running Sterling Integrator). It does this by enabling Sterling Integrator to mail (send) documents using SMTP, within Sterling Integrator, to the mail server.


Create a BP for DeEnveloping:

SI Inbound Process-3


Deploying a Business Process:

  • Go to Business Process Manager
  • Then click GO next to Create Process Definition
  • Type the name of the business process in the text area
  • If you click check Business process you need to navigate to the location where the Your BP has saved using Browse
  • If you click Business Process Text Editor you need to paste BPML code or you can create BPML using XML.
  • Then click next.
SI Inbound Process-4


SI Inbound Process-5




SOURCE CODE: 

<process name="vdunna_deenvelope_email">
  <sequence name="Sequence Start">
    <operation name="X12 De-envelope">
      <participant name="DeenvelopeX12"/>
      <output message="DeenvelopeX12TypeInputMessage">
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

  </sequence>
</process>

Then Click  next.
Click Next
Click Next
Click Next
Click Finish

The BP will be deployed into the SI

Now, creating an BP for Collecting a file and for Email Notification:


BP for Collecting a file and for Email Notification



BP for Collecting a file and for Email Notification-1



How To Configure File System Adapter:


Collects (imports files from the FileSystemAdapter and extracts (exports) files to the file system.

Action:

Collection (which collects the document from specified folder in local system).
Extraction (which extracts the document from specified folder into local system)
Collection Folder:  
The path of the collection folder location

Eg: c:vdunna\collect

Extraction Folder: 

The path of the extraction folder located.

Eg: c:vdunna\extract

Bootstrap : yes (we are using child process for the bp)

Initial WorkFlow Id: Specify the Deenvelope Bp which you have created  before.

Assign: 

The assign element is a BPML construct you can use to perform simple assignment operations within a service call. You can also use assign statements outside of any operation, input, or output tags. Sometimes called top-level assignment, this method enables you to manipulate the process data directly, outside the service call in a process rather than within the service step. 

File System Adapter


Configure: Assign

append: true
from:concat('Error in:',//ProcessData/BPDATA/WFD_NAME/text())
to:doc/docname


Assign


configure:

append: true
from:concat('PID is: ', //ProcessData/BPDATA/WORKFLOW_ID/text())
to:doc/docname

XML Encoder


Mode: Whether translation is performed on an input file, if the input file is already in the XML format then the file can be imported directly attached to the process data.
Encode Non-XML document.
Using existing XML document
Create document using Xpath.

root_element: This field is mandatory. Root element name of the document containing result of Xpath expression.

Xpath: When value in mode field is process_data_to_document then the value is a string.


FSA Configuration


configure:

append: false
from:concat('Error in:',//ProcessData/BPDATA/WFD_NAME/text())

to:doc/docname


SMTP Configuration in SI


How to Configure SMTP Send Adapter:


This Adapter allows documents to be send to any valid email address by using an accessible mail server. The back end mail server examines the document and does the further mail processing.

xport-smtp-mailfrom:  we provide the sender mail id, where the mail has to sent. For Eg: abc@xyz.com
xport-smtp-mailto: we provide the receiver mail id, to whom the mail should be sent. For Eg: abc@xyz.com

xport-smtp-mailhost: the back end mail server fro the mail we are sending. For Eg: abc@xyz.com

xport-smtp-mailport: the port number of the mail host. 
For Eg: 25

xport-smtp-mailsubject: the subject what we desire to appear in the email subject. For Eg: “Error Notification”.

If we want some data to be concatenated with the values we go for xpath and put a tick mark in the xpath field.


After successful configuration of the services used in the bpml , the bpml should be validated and Business Process Definition is created. 


How To Deploy a business process in SI:


  1. Go to Business Process Manager
  2. Then click GO next to Create Process Definition
  3. Type the name of the business process in the text area
  4. If you click check Business process you need to navigate to the location where the Your BP has saved using Browse
  5. If you click Business Process Text Editor you need to paste BPML code or you can create BPML using XML.
  6. Then click next.

How to deploy the business process in SI

Generic Inbound Process

Source code:

<process name="vdunna_2coll">
  <sequence name="Sequence Start">
    <operation name="Business Process Metadata">
      <participant name="BPMetaDataInfoService"/>
      <output message="BPMetaDataServiceTypeInputMessage">
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

    <operation name="File System Adapter">
      <participant name="E5FileSystem"/>
      <output message="FileSystemInputMessage">
        <assign to="Action">FS_COLLECT</assign>
        <assign to="bootstrap">true</assign>
        <assign to="collectionFolder">\\172.17.4.206\b2bGIS\ITG40-41\vdunna\Collection</assign>
        <assign to="deleteAfterCollect">true</assign>
        <assign to="initialWorkFlowId">vdunna_deenvelope_email</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>

    <onFault>
      <sequence name="Sequence Start">
        <assign name="Assign" to="doc/docname" from="concat(&apos;Error in:&apos;,//ProcessData/BPDATA/WFD_NAME/text())" append="true"></assign>
        <assign name="Assign" to="doc/docname" from="concat(&apos;PID is: &apos;, //ProcessData/BPDATA/WORKFLOW_ID/text())" append="true"></assign>
        <operation name="XML Encoder">
          <participant name="XMLEncoder"/>
          <output message="XMLEncoderTypeInputMessage">
            <assign to="mode">process_data_to_document</assign>
            <assign to="root_element">doc</assign>
            <assign to="xPath">/ProcessData/doc/node()</assign>
            <assign to="." from="*"></assign>
          </output>
          <input message="inmsg">
            <assign to="." from="*"></assign>
          </input>
        </operation>

        <assign name="Assign" to="Error" from="concat(&apos;Error in:&apos;,//ProcessData/BPDATA/WFD_NAME/text())"></assign>
        <operation name="SMTP Send Adapter">
          <participant name="SMTP_SEND_ADAPTER"/>
          <output message="SMTP_SEND_ADAPTERInputMessage">
            <assign to="xport-smtp-mailfrom">abc@xyz.com</assign>
            <assign to="xport-smtp-mailhost">abc@xyz.com</assign>
            <assign to="xport-smtp-mailport">25</assign>
            <assign to="xport-smtp-mailsubject" from="/ProcessData/Error/text()"></assign>
            <assign to="xport-smtp-mailto">abc@xyz.com</assign>
            <assign to="." from="*"></assign>
          </output>
          <input message="inmsg">
            <assign to="." from="*"></assign>
          </input>
        </operation>

      </sequence>
    </onFault>
  </sequence>
</process>

Click Next

Click Next 

Click Next

Click Finish

The BP will be deployed into the SI

Now, we should create an BP for the Extraction:

FSA With Extraction


Creating  the ISA,GS,ST envelopes for the Inbound map in IBM Sterling Integrator:


Creating  ISA-IEA  envelopes:

Creating Envelopes for Inbound

Goto Trading Patners -->document Envelopes --> Envelopes

Creating ISA IEA Envelopes

Then click go next to create New Envelopes

Select X12 from List of Envelop Statndards then click next

Select Inbound x12 ISA IEA Envelopes from Envelopes Standards X12 click next

Select Base Envelope, if already you have created envelopes or click next


Give the name and description

NOTE: Blue colour indicates that the fields are mandatory.

1. In this envelope the specified  Sender ID and Receiver ID should match with the sender id and receiver id of the map which we have deployed at the beginning.

2.The version given here should also match with the map which we had deployed.

Click next
Click next
Then click finish.

Click Return

Creating GS GE Envelopes:


Click go next to new envelopes
Select ASCII X12 from standards
Select Inbound –X12 GS GE Envelopes from Envelope Standards X12
Click next and click next as we are creating new envelopes for GS and GE
Print the name and description then click next

Provide the GS details.

1.  In this envelope the specified  Sender ID and Receiver ID should match with the sender id and receiver id of the map which we have deployed at the beginning.

2.The version given here should also match with the map which we had deployed.

• Click next
• Click next
• Click next
• Then click finish.

• Click Return

Creating ST SE Envelopes:

• Click go next to New Envelope
• Select ASCII X12 from Standards
• Select inbound ST SE envelopes from Standards X12
• Click next
• Click next
• Print the name and description of the ST SE Envelopes
• Click next

1. In this envelope the specified  Sender ID and Receiver ID should match with the sender id and receiver id of the map which we have deployed at the beginning.

2. The version given here should also match with the map which we had deployed.


• Click next

• Click next

• Select yes for Compliance check then click next

• Select Specify for Map Name mode then click next

• Select translate Transaction as yes and click next.

• Click next.

• Click next.


Select Specifying a business process and click on next

After clicking on next select a business process of Extraction which you have 

deployed before for collecting a file from file system from the Business Process List

• Click next

• Click next
  
• Then click finish.


Click Return

Execution of inbound process:


• Select  Business Process ->  Manager

• Search Document Collect BP using search option

• Select Execution Manager

• Before click to execute, copy an input file into the collection folder path as you specified

• Click Execute

• Click Go

If there is no errors in the BP then, output  will be displayed as shown above screen shot.

The given file in Collection folder  will be collected  in the Extraction Folder  as the path you specified.

Check your mail to see the generated output

SI Sample Email