Version 2.3.1.18
 —  SAP R/3 Gateway Documentation  —

Configuring and Implementing Pipelines

A pipeline transports the IDoc messages from a creator to a consumer. During transport, there may be several steps for transformation. A pipeline step works transactionally. The step must be committed or backed out. When a step is backed out, it will be performed later. When a step is committed, the pipeline continues processing and the next pipeline step is called.

graphics/pipe.png

From a technical or Broker view, a pipeline contains many queues. The pipeline page http://YourGateway:8080/sapr3gateway/manager/pipelines gives an overview of all pipelines.

graphics/pipelines.png

You can scroll down


Creating a Pipeline

It is possible to create your own pipeline on http://YourGateway:8080/sapr3gateway/manager/pipelines.

To create a new pipeline view, press the Create new Pipeline link.

graphics/pipelineCreate.png

The next dialog asks for more parameters depending on the selected pipeline step.

Parameter Description
Name Name of the pipeline.
Description Document the pipeline or a pipeline step.
Create new Pipeline Step Opens the dialog to create a new step at the end of the pipeline. You will be prompted for the type of step. After selecting the type, press the Save button. You will be prompted for more parameters depending on the type selected.
Delete Delete this pipeline step
Up Move the position of this step up
Down Move the position of this step down
Type: Queue Shows the status information of Broker queue. The broker address and queue name are needed as additional parameters to retrieve the information. For example: the number of accepted UOWs is displayed. Depending on EntireX Broker UWSTATP parameter, the number of processed, backouted or canceled UOWs are displayed.

Tip:
This pipeline step takes a long time on many (greater than 1000) UOWs. Use Queue Info Service pipeline step for a quicker response time.

Type: Queue Info Service Shows the number of accepted UOWs, the lifetime and the limit number of UOWs for this service.
Type: Running Task Shows the status information of the selected Running Task. The dialog shows the available tasks that can be selected. Start and Stop operations are still available.
Type Attach Manager Shows the status information of the selected Attach Manager. The dialog shows the available items that can be selected. Start, Stop and Simulate operations are still available.

Note:
The Simulate process can only run if the Attach Manager is or was running.

Type: Timer Task Shows the status information of the selected Timer Task. The dialog shows the available items that can be selected. Start, Stop and Simulate operations are still available.
Type: Service Shows the EntireX Broker service information. The broker address and service name (CLASS/SERVICE/SERVER) are needed as additional parameters to retrieve the information. For example: The number of active servers is displayed.
Type: Import Pipeline Shows the referenced pipeline in the current pipeline. The dialog shows all of the pipelines that are available.

Caution:
The current pipeline is disabled, but, you should not build a cycle.

Type: Child Pipeline Shows the referenced pipeline as a child of this pipeline. The dialog shows all of the pipelines that are available.

Caution:
The current pipeline is disabled, but you should not build a cycle.

Tip:
This feature allows you to build a business pipeline for your complete application. A subsequent child pipeline is in this case an outbound and an inbound pipeline.

Queue Message Contents Shows the command for reading the next UOW message and displays the contents in new browser window. To read the existing UOW as server, logon parameters Broker, Service, User ID and Token are required.
Save Saves the selection and changes.
Type: Name Shows the name of referenced component. The name can be selected depending on the previously selected pipeline step type.

Note:
The selected component is referenced by name. After renaming the referenced component, this value must also be changed. Otherwise, this pipeline step will not be able to display any information about the referenced component.

Hide Select hide=no to show this pipeline step. With hide=yes the step is hidden.

The following sections (Inbound and Outbound) explain 2 examples of pipelines. Display these and use them as templates to create your own.

Top of page

The IDoc Inbound Pipeline

The IDoc Inbound pipeline is created on the Setup Wizard IDoc XML Gateway (http://YourGateway:8080/sapr3gateway/manager/setupWizardIDocXMLGW) with all steps. Use the Show link on the starting pipeline page to display the status of this pipeline.

graphics/pipelineIDocInbound.png

Use Natural or COBOL to create an IDoc document for this pipeline. The development section Natural IDoc Client (or for COBOL) describes all of the steps. After running the Natural IDoc PMQ client, you will see a message in the first pipeline step as accepted. Start the other pipeline steps (Attach Manager and Rpc2Rfc kernel) to deliver the document.

Note:
The SAP R/3 application server must handle the IDoc type that is created by a partner. Please read the section to configure the partner for a specific IDoc type.

The IDocService Attach Manager receives a message from the EntireX Broker if one UOW is created. Now, the associated stylesheet XMLToIDoc_FromPMQ will be called. To display or change the following configuration, use the link with the name of the attach manager in pipeline view.

graphics/pipelineIDocInboundConfig.png

The stylesheet performs the transformation and delivers the IDoc to SAP. For the delivery process, the Rpc2Rfc kernel is used. The function IDOC_INBOUND_ASYNCHRONOUS is called in transactional RFC (tRFC) mode. To call the Rpc2Rfc kernel service, the following parameters can be passed to the stylesheet.

Parameter Description
rpc-broker Forwards the request to this broker
rpc-service Sends the RPC request to this CLASS/SERVER/SERVICE.
rpc-userid Connects with this user ID as client.
rpc-password The EntireX security password for logon with user ID.

Start of instruction setTrace Inbound Processing

  1. The System Log contains information about the Rpc2Rfc and the result of XMLToIDoc_FromPMQ stylesheet processing. The delivery process is successful if there is a tRFC transaction ID logged.

  2. To show the incoming IDoc in the SAP application server, start the transaction we02.

  3. To trace the incoming tRFC requests, use transaction sm58.

Top of page

The IDoc Outbound Pipeline

The IDoc Inbound pipeline is created on the Setup Wizard IDoc XML Gateway (http://YourGateway:8080/sapr3gateway/manager/setupWizardIDocXMLGW) with all of the steps. Use the Show link when starting a pipeline page to display the status of this pipeline. The following example displays one UOW in the pipeline

graphics/pipelineIDocOutbound.png

Use the Start and Simulate links of the IDocService Attach Manager to transform plain IDoc format to XML. After this pipeline step, the IDoc is forwarded to the QUEUE/OUTBOUND-IDOC-XML/TEST queue.

To deliver the XML IDoc to your application, change the stylesheet which is called in Attach Manager IDocService for the service QUEUE/OUTBOUND-IDOC-XML/TEST. Depending on the stylesheet, there are additional parameters. Add these parameters as HTTP-GET parameters to the configuration of IDocService.

Available Stylesheet Description
PMQdoc_toRPC Reads the XML document from queue and forwards it to an HTTP XML-RPC server. Adds the rpc-broker and rpc-service parameters for the EntireX XML-RPC server. To develop an XML-RPC server for receiving XML documents and calling RPC subprograms, use the Outbound XML-RPC Development section.
PMQdoc_toMail Reads the XML document from queue and sends the contents as mail. Adds the to parameter for the receiver's e-mail address.
PMQdoc_toFile Reads the XML document and saves the contents as a file. The filename is created from the UOW ID. Adds the path parameter for the target directory.
PMQdoc_toPMQ Reads the XML document and saves the contents in the next PMQ. Addresses the receiver PMQ with the nextBroker (the Broker IP/DNS) and nextService (CLASS/SERVER/SERVICE) parameters.
PMQdoc_toXBD Reads the XML document and sends the contents to the Service Orchestrator. The receiver is a Mediator sequence. To address the sequence, add the HTTP parameter href for the Mediator web client and xbd.sequence.uri for calling the sequence.

All PMQdoc stylesheets include a customer stylesheet for your own transformations. The name of this stylesheet is XMLIDoc_ToCustom.xsl and does not perform transformation. The contents of PMQ are delivered 1:1 to the target RPC, mail or file. Add custom transformations to this stylesheet to receive IDocs in your business application.

Top of page

Setup UOW Controller

The UOW controller checks all accepted units of work (UOWs) in one webMethods EntireX Broker (see the section Using Persistence and Units of Work in the webMethods EntireX documentation). If forward processing has stopped for one UOW, the next pipeline step will be searched. The next pipeline step will be called to restart pipeline processing.

For example, at the end of an outbound pipeline, the pipeline consumer must send a message to an e-mail system. The consumer performs a backout if an error is detected. The next UOW controller process restarts the pipeline consumer to deliver the message.

Create a Scheduler Timer Task to start the UOW controller within a certain period of time. Use the URL SM_URL/UOWcontroller in the field Command. Optionally, the following parameters can also be passed

HTTP-Get Parameter Description
broker The broker IP or DNS address.
deliveryCountLimit The default is 1. It performs only UOWs with a delivery count of 1 or higher. Refer to the section Using Persistence and Units of Work in the webMethods EntireX documentation for more details.

Tip:
Create two Scheduler Timer Tasks. One timer task works with deliveryCountLimit=1 in a short period and the second with deliveryCountLimit=0 in a 1-day period.

If you call the UOW controller from the menu, you will be prompted for the Broker IP or DNS address.

Top of page

Using Pipeline View

The pipelines already defined allow you to control the business message flow. All of the pipeline steps defined for a pipeline are displayed on a page. To display this page, select the pipeline with the Show button on the pipeline page. On the selected pipeline, there are links to start the next activities.

pipeline view

This example shows the inbound and outbound in one parent IDoc Exchange pipeline view. The children are indented.

Pipeline: ...

The Pipeline Name

The pipeline title name is displayed if the parent definition contains a child pipeline step. This link shows the pipeline definition. The Show button displays only this pipeline on the next page. You can use this button to drill down to your information and display the page more quickly.

Attach Manager

Running Task

Timer Task

Queue and Service

The Queue and Service rows display EntireX Broker resource information used by the pipeline messages.

Top of page

Outbound XML-RPC Development

This development environment allows you to receive IDoc documents as a pipeline message consumer. The goal is to receive the IDoc document with the business parameter in a sub-program. The sub-program is called at runtime from an EntireX RPC server. The following development steps are necessary.

Start of instruction setDeliver IDoc to RPC Server

  1. Create and setup the Outbound XML-RPC Development with the Setup Wizard on Help and Setup Wizard IDoc XML Gateway, if this has not already been done. After creation, the development environment exists on the Development page.

  2. Create the IDoc type information in IDoc XML gateway.

  3. Select Minimum IDL to create the IDL from the IDoc type information. Copy the content of the newly created windows to your clipboard.

  4. Go to the Outbound XML-RPC Development on the developer page, choose Edit IDL and copy the contents of the clipboard to the end of the existing IDL. Check if the new contents already exist.

  5. Edit and expand the IDL.

    In summary to make all of the changes, the following IDL can used as an example:

    Program 'IDOCRCVN' Is       /*  'DEBCOR'
      Define Data Parameter
        1 MESSAGE  Out
          2 NO (N4)
          2 TEXT (A60)
        1 E1KNA1C  In /* Core Master Kundenstamm Grunddaten (KNA1)
          2 MSGFN (A3)        /* Function
          2 KUNNR (A10)        /* Customer number
          2 ANRED (A15)        /* Title
          ....
          2 SPRAS_ISO (A2)        /* Language according to ISO 639
      End-Define
  6. Click Generate Source to generate an XMM mapping file. The EntireX Workbench is called in batch mode. The mapping file is copied to the IDoc XML Gateway. To change the destination directory, go to Configuration, Development, and select this development environment. The XMM mapping file is used by an EntireX servlet adapter to map an XML document to an RPC call.

  7. To activate the new XMM file, restart IDoc XML gateway. For example, use the Tomcat manager.

  8. Develop a sub-program (e.g. Natural) with the name and parameter data area which is defined in the IDL (step 5 above).

  9. Start and check the RPC server which is to call the developed sub-program.

  10. Change the attach manager configuration to send the outbound IDoc as XML. Set the PMQdoc_toRPC stylesheet and the RPC HTTP-Get parameter for the XML-RPC adapter.

    HTTP Get Parameter Description
    rpc-broker Broker IP-address of the called sub-program.
    rpc-service Sevice (CLASS/SERVER/SERVICE) of the called sub-program.

    For example, use

    XSLT_URL/PMQdoc_toRPC?rpc-broker=localhost&rpc-service=RPC/SRV1/CALLNAT

    as URL on service OUTBOUND-IDOC-XML.

    XSLT_URL is replaced at runtime by the value defined in System Constants. To activate the change, stop and restart the Attach Manager.

  11. Depending on step 5, the next section describes a transformation from IDoc to RPC.

Start of instruction setDevelop IDoc to RPC Transformation

As default, the IDoc is transformed to XML and this XML document calls the RPC server. To transform between the IDoc-XML document and the required XML-RPC document, it is possible to add XSL transformation statements.

  1. To transform between the two XML documents, the XMLIDoc_ToCustom.xsl stylesheet is called from IDoc XML Gateway at runtime. To add your own transformation, go to Tools, Files and edit the file XML IDoc to Custom Transformation, or start an editor with this file in the root directory of IDoc XML Gateway.

  2. Add an xsl:template that matches if the IDoc type is transformed. Use the attribute priority to overwrite the default.

    <xsl:template match="DEBCOR01" priority="1">
      ....
    </xsl:template>

    In this example the DEBCOR01 IDoc type matches.

  3. To this template, add rules to transform the IDoc type name to the sub-program name.

    <xsl:template match="DEBCOR01" priority="1">
       <IDOCRCVN>
          ....
       </IDOCRCVN>
    </xsl:template>
  4. Copy 1:1 all IDoc segments to the XML-RPC document.

    <xsl:template match="DEBCOR01" priority="1">
       <IDOCRCVN>
          <xsl:copy-of select="//E1KNA1C"/>
       </IDOCRCVN>
    </xsl:template>
  5. The called sub-program can determine at runtime if the document has been successfully processed. The out parameter replies with this information. The response code true commits the IDoc document as a UOW and false backs out. It this case, the same document can also be delivered later. To reply to the response, add an xsl:template with mode doEvaluateResponseCode.

    <xsl:template match="*" mode="doEvaluateResponseCode">
       ....
    </xsl:template>
  6. The RPC response document is passed to this template. It is now possible to evaluate whether to commit the UOW (return true) or to back it out (return false).

    <xsl:template match="*" mode="doEvaluateResponseCode">
       <xsl:choose>
          <xsl:when test="//MESSAGE/NO = '4'">
             <!-- Adabas Record successfully stored -->
             <xsl:text>true</xsl:text>
          </xsl:when>
    
          <xsl:when test="//MESSAGE/NO = '5'">
             <!-- Adabas Record successfully updated -->
             <xsl:text>true</xsl:text>
          </xsl:when>
    
          <xsl:otherwise>
             <xsl:text>false</xsl:text>				
          </xsl:otherwise>
       </xsl:choose>
    </xsl:template>

    Note:
    The XPath expression contains the field names of IDL in the above example.

  7. To restart the delivery process after an UOW backout, implement a UOW Controller.

  8. In case of error (backout of UOW), the response message of the called sub-program can be logged. Add an xsl:template with mode doEvaluateResponseMessage. The RPC response document is passed to this template.

    <xsl:template match="*" mode="doEvaluateResponseMessage">
       <xsl:value-of select="//MESSAGE/TEXT"/>
    </xsl:template>

Top of page