Tag: SAP Process Orchestration (PO)

This blog is about SAP Process Orchestration, so I blog about it quite often. After all, PI and PO are a great integration platforms (with bad documentations).

BPMN Undeployment with NWDS

BPMN Undeployment with NWDS

Scenario

If you do not need a process anymore, it makes sense to undeploy a BPMN to free some resources.

Undeployment of a BPMN with NWDs

A BPMN can be undeployed with the help of the Netweaver Developer Studio (NWDS). Simply follow the steps below:

  1. Open the NWDS and connect to your PO system
  2. Open the “Deployment” perspective
  3. Wait till the list of BPMNs on the left side is loaded, click on your process and drag the object into the “Undeployment list” on the right side
  4. Click on the “Start” button

    NWDS: Process undeployment
    NWDS: Process undeployment
  5. After some seconds the process should be undeployed
SOAP Authentication with URL Parameters

SOAP Authentication with URL Parameters

Scenario

In one of my latest project we set up a SOAP communication with a partner. Unfortunately, the partner was not able to include basic authentication header when sending a SOAP message. As we did not want to expose our SOAP Sender communication channel to the web, but could not wait for the partner to find a way to use basic authentication, we looked for another solution.

Solution

It is possible to include the webservice credentials into the URL. Just add the following two parameters to the query string of your URL and replace USER and PASSWORD with the configured values.

&j_username=USER&j_password=PASSWORD

Please keep in mind that this solution is highly insecure as the username and password are exposed!

Peer certificate rejected by ChainVerifier

Peer certificate rejected by ChainVerifier

Scenario

In a scenario with a SSL encrypted (HTTPS) SOAP target URL in the SOAP receiver channel, the message goes into an error state.

Error

The following error is shown in Message Log in PIMON:

SOAP: Call failed: java.io.IOException: Failed to get the input stream from socket: iaik.security.ssl.SSLCertificateException: Peer certificate rejected by ChainVerifier

Solution

The SSL certificate needs to be imported into PIs keystore.

Download the certificate from the target server
  1. Open the Target URL in Chrome (or any other Browser)
  2. Open the developer tools by clicking on the three dots -> More Tools -> Developer Tools (Shortcut STRG + SHIFT + I)

    Chrome: Open developer tools
    Chrome: Open developer tools
  3. Go to the “Security” Tab and click on “View certificate”
  4. Go to the Details Tab and click on “Copy to file” button
  5. Click on the “Next” button and select “DER-codet-binary X.509 (.CER)”

    Download Certificate
    Download Certificate
  6. Click on “Next” button and select a destination on you local PC
Import certificate into keystore
  1. Open the Netweaver Administrator (http://your.pi:port/nwa)
  2. Go to Configuration -> Security -> Certificates and Keys
  3. Select the “Trusted CAs” View and click on “Import Entry”
  4. Select entry type “X.509 Certificate”, enter the path to the certificate you downloaded before and click on “Import”

    Certificates and Keys: Import entry
    Certificates and Keys: Import entry
  5. Resend your message

If your error is not resolved, open the certificate again and click on certification path. Afterwards, double click the first and second certificate (one after each other), save them and also import them into the TrustedCAx view.

Find complete BPMN error traces

Find complete BPMN error traces

Scenario

During the development of a BPMN on SAP Process Orchestration you will probably arrive at a point where your Process does not work as expected. One way to find the issue is to check the traces in the Log Viewer, to find out more about the error.

Find the traces in the Log Viewer

  1. Triggered the BPMN to run again
  2. To check the BPM Status open PIMON (http://your.po:port/pimon)
  3. Go to Monitoring -> Processes and Tasks -> Manage Process
  4. Open the “History” Tab and select “Show: Advanced”. You can find the Log ID in the log entries below.
    Manage Processes: Find Log Id
    Manage Processes: Find Log Id

    If the following message is shown:

    For more details, decrease severity of log controller as described in SAP Note 1753560.

    Please check the section Increase BPMN Trace level and afterwards start again with step 1.

  5. Open  the NetWeaver Administrator (http://your.po:port/nwa)
  6. Got to Troubleshooting -> Logs and Traces -> Log Viewer
  7. Open View -> Open View -> System Logs and Traces

    Open "System Logs and Traces" view in Log Viewer
    Open “System Logs and Traces” view in Log Viewer
  8. Add a filter for Log ID and enter the Log ID out of the “Manage Processes” View

    NWA Log Viewer: Filter for LogId
    NWA Log Viewer: Filter for Log ID
  9. You can find the whole error trace in the filtered results.

Increase BPMN trace level

To increase the BPMN trace level follow the steps below:

  1. Open  the NetWeaver Administrator (http://your.po:port/nwa)
  2. Go to Configuration -> Infrastructure -> Log Configuration
  3. Select “Show: Tracing Locations”
  4. Click on “Open Filter” and filter for Location “BPMNException”
  5. Change Severity for location “ExceptionAdapter$BPMNException” to “ALL”

    NWA Log Configuration: Increase Severity for ExceptionAdapter$BPMNException
    NWA Log Configuration: Increase Severity for ExceptionAdapter$BPMNException
  6. Click on “Save Configuration” and trigger your BPMN again

Also, check out SAP Note 1753560.

“Start Process” in Process Repository is disabled

“Start Process” in Process Repository is disabled

Scenario

If you develop a BPMN, you probably have to manually trigger the process multiple times to check that everything works as expected. One way to trigger a BPMN is the usage of the “Start Process” function in the Process Repository.

You can find the Process Repository in the NetWeaver Administrator -> Processes and Tasks -> Process Repository.

Error

The “Start Process…” button in the Process Repository is disabled.

"Start Process..." button in Process Repository is disabled
“Start Process…” button in Process Repository is disabled

Solution

The role “SAP_BPM_SuperAdmin” is necessary to use the “Start process…” function. To add the role to your user, follow the steps below:

  1. Open the NetWeaver Administrator (http://your.pi/nwa)
  2. Go to Configuration -> Security -> Identity Management
  3. Select you User and open the “Assigned Roles” Tab
  4. Click on “Modify” and search for the role “SAP_BPM_SuperAdmin”
  5. Select the role, click on “Add” and afterwards on “Save”
    Add role SAP_BPM_SuperAdmin to user
    Add role SAP_BPM_SuperAdmin to user

     

After refreshing the repository browser, the “Start Process…” button should be available.

Error during BPMN deployment

Error during BPMN deployment

Scenario

Developing and debugging a BPMN can be a nightmare. The build and redeployment of a BPMN can take up to five minutes and lead to multiple errors.

After multiple successful deployments, it was no longer possible to deploy or undeploy a process.

Error

The following error message was shown in the deployment log of SAP NetWeaver Developer Studio:

Description: Description: 1. Adapter com.sap.glx.adapter.internal.Transformer has refused deploy unit e5853c8198e860817e261ae672f4bfc4 using configuration mode DEPLOYMENT

-> Transformer could not get lock within 60 seconds

Solution

Restart the Galaxy Core Service to fix the issue. This can be done like this:

  1. Open the NetWeaver Administrator (http://your.pi:port/nwa)
  2. Go to Operations -> Systems -> Start & Stop -> Java Services
  3. Search for Name “Galaxy Core Service”
  4. Select your Instance and click on Restart
  5. Wait some seconds and  try to deploy your service again
NWA: Restart Galaxy Core Service
NWA: Restart Galaxy Core Service
Forbidden Error in XI Receiver Channel

Forbidden Error in XI Receiver Channel

Scenario

In a configuration with an SAP R3 system as receiver, which is connected via a XI Receiver Channel, the message cannot be delivered to the target system.

Error

The following message is shown in the Message Log of PIMON:

SOAP: Error occurred: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 403 Forbidden

Exception caught by adapter framework: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 403 Forbidden

Transmitting the message to endpoint <local> using connection JPR failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: HTTP Error response for SOAP request or invalid content-type.; HTTP 403 Forbidden

Solution

Activate the Integration Engine Service on your target system:

  1. Open SAP GUI and connect to your target system
  2. Open transaction “SICF”
  3. Enter “/sap/xi/engine” as “Service Path” and click execute

    Transaction SCIF: Service Path /sap/xi/engine
    Transaction SCIF: Service Path /sap/xi/engine
  4. Right click on “Integration Engine (SAP XI Message Format)” and select “Activate Service”

    Transaction SCIF: Activate Integration Engine Service
    Transaction SCIF: Activate Integration Engine Service
  5. Restart your message
  6. If it still does not work, check that the used user has the role “SAP_XI_APPL_SERV_USER”
IDOC_ERROR_PARSE_FAILURE: Namespace in IDOCs

IDOC_ERROR_PARSE_FAILURE: Namespace in IDOCs

Scenario:

In a SOAP to IDOC scenario with a XSLT mapping, the receiving IDOC Communication Channel produced an error message.

Error:

The following error message is shown in the Message Log:

Error before sending due to idoc parsing error: (7) IDOC_ERROR_PARSE_FAILURE: Invalid XML 1.0 character encountered within IDoc-XML for type <ORDERS05>:
state=EXPECTING_IMMEDIATE_TAG_END, charPosition=64, lineNumber=1, columnNumber=65, invalidChar=U+0078,
sourceSnippet=…UTF-8″ standalone=”no”?><ORDERS05 xmlns:a=”http://example.namespace.com/order”><IDOC BEGIN=”1″><EDI_DC40 SEGMENT=”1…
—————————————————^

Error Message in PIMON Message Monitor
Error Message in PIMON Message Monitor

Solution:

Namespaces are not allowed in IDOCs. You can add the exclude-result-prefixes parameter to your stylesheet definition to make sure that the given namespaces are not added to the target document.

<ns0:stylesheet version="1.0" xmlns:a="http://example.namespace.com/order" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="a">

Multiple namespaces can be added by using a white space as separator:

<ns0:stylesheet version="1.0" xmlns:a="http://example.namespace.com/order" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="a b c">
Unique Filenames with AS2 Communication Channel

Unique Filenames with AS2 Communication Channel

During the implementation of multiple AS2 interfaces, I found myself very often in a situation where the communication partner expected unique AS2 filenames. Unfortunately, if you leave the filename parameter in an AS2 Receiver Communication Channel (CC) blank, the filename will always be your PIs system name. In case you enter a value like “Invoice”, the filename will always be set to “Invoice”.

Solution:

  1. You can use a dynamic configuration to generate unique filenames. Just add a UDF to you message mapping which sets the property “AS2Filename” in the namespace “http://sap.com/xi/XI/AS2/AS2“. Also, do not forget to enable the checkbox “Respect parameters” in the AS2 Communication Channels configuration.
  2. If you want to generate random, unique filenames only, a dynamic configuration feels like to much effort. Fortunately, there is an easier way to generate unique filename. Just put “%MSGID” into the “Filename” parameter of your AS2 Receiver Communication Channel. The parameter will be replaced with the PIs message ID, which should be unique. Additionally, it is possible to combine the placeholer with static text like “%MSGID.xml”.
    MSGID placeholder in filename parameter in AS2 Receiver Communication Channel
    MSGID placeholder in filename parameter in AS2 Receiver Communication Channel

    Be aware that in case your message fails, in every attempt to resend the mesasge the filename will be the same. Luckily, there are more placeholders available:

    Placeholder Description
    %SEQNUM A sequence number, starting with 1
    %RTSEQNUM A server wide sequence number, starting with 1
    %START The start time of the adapter
    %TIME The archiving period in milliseconds
    %MSGID The XI message ID

If you would like to find out more about the AS2 Adapter, check out the SAP Documentation.

Archive Files with the File Receiver Communication Channel

Archive Files with the File Receiver Communication Channel

The File Sender Communication Channel is able to move processed file to an archive directory and append the current timestamp. The File Receiver Communication Channel lacks an parameter to archive files. This is okay in most cases. The receiving system should take care of the file after processing. But, what if the demand is to move a file to an archive directory on the receiving system before overwriting it?

Solutions:

  1. It is possible to use an (cc)BPM(N) which orchestrates the archiving and the creation of the new file. You would need a configuration, a File Sender Communication Channel, a File Receiver Communication Channel and dummy interfaces to grab the old file and move it to a new directory. After the archiving is done, you can use a second configuration to store the new file. In addition, a third configuration is necessary which receives the source file and triggers the ccBPM or BPM. One BPM and three configurations – a lot afford for a simple archive.
  2. The File Receiver Communication Channel has a parameter to run script or commands on the operating system before and after creating the file. A simple move command wil do the trick.
    If your SAP Process Integration / Process Orchestration runs on Unix, use

    mv test.xml archive/test_$(date +%Y-%m-%d).xml

    If your SAP Process Integration / Process Orchestration runs on Windows, use

    ren “test.xml” “test_%date:~10,4%%date:~7,2%%date:~4,2%.xml”

    Move command in File Receiver Communicaiton Channel
    Move command in File Receiver Communicaiton Channel

    In case you use dynamic filenames, you can use the following placeholders:

    Placeholder Description
    %F target file path
    %f target file name

    Unfortunately, this will only work in NFS mode. You could create a script which connects to the FTP server and archives the file and run this script with the Communication Channel, but I would highly advise against this.

To read more about the File Receiver Communication Channel, check out the SAP Documentation.