Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

In SAP NetWeaver Process Integration (PI) 7.1, there is support for using parameters in mapping programs.  In general, the ability to pass parameters to/from mapping programs gives them more flexibility and applicability by allowing for the transfer of values at configuration time (e.g. Integration Directory).  This is similar to the concept of using parameters for a program method or procedure.  Currently, parameterized mappings are supported for:

  • Message Mappings
  • Java Mappings
  • XSLT Mappings

Since at runtime time, all PI mappings are accessed via a corresponding operation mapping, parameter bindings must be created in order to connect the mapping program and operation mapping parameters. In addition, the actual parameter values can be set at configuration time by using a transformation step in an integration process or monitoring process.

Export Parameters - transfer values from mapping

  • Values can only be assigned to export parameters in user-defined functions
  • Values can only be passed using a transformation step and thus, can only be evaluated within integration processes or monitoring processes

Parameter Category

  • Simple Type - parameters in this category are used to transfer simple typed constants (i.e. xsd:string or xsd:integer) that can be used as import or export parameters.
  • Adapter - parameters in this category are used to transfer the channel name that is to be used for mapping lookups. An adapter type (e.g. JDBC, RFC) must in addition be selected.

The value set in the Message Mapping for Export parameter can be used in BPM.

Following are the steps to use an export parameter:

1)      Create a export parameter

In the signature tab of Message Mapping create a parameter with following options:

Category: Simple Type

Type: string

Parameter: Export

 

 

2)      Setting the value to this export parameter using UDF:

Using the following the populate the value of the export parameter.

 

public String demo(String v1, String v2, Container container) throws StreamTransformationException{

String out = "";

 GlobalContainer gc = container.getGlobalContainer();

OutputParameters params= gc.getOutputParameters();

if(v1.equals(v2))

{

            if(params.exists("exportParam") == true)

             {

                        params.setString("exportParam", "Yes");

                        out = "value exists!";

            }

            else

             {

                 params.setString("exportParam", "No");

                                    out = "value doesn't exist!";

            }

return out;

 }

else

{ params.setString("exportParam", "No");

  return " Check for errors ";

}

}

 

Calling the UDF:

 

 

BPM:

3)      Create 3 container elements:

  • ·         IN1:  Outbound Service Interface for receiver step.
  • ·         IN2: Inbound Service Interface for Sender Step.
  • ·         var1: for the export parameter set in Message Mapping.

 

 

4)      Receiver Step:

Select the IN1 as the Message

 

5)      Transformation Step:

Select the Export, Source Message and Target Message.

 

6)      Switch Step:

For the condition of the switch step give (var1 = “No”)

 

7)      Branch 1 Send Step:

Select the Message as IN2

 

 

😎      Branch 2 Control Step:

To end the process, select the Action as Cancel Process

 

2 Comments