cancel
Showing results for 
Search instead for 
Did you mean: 

how to call mapping parameter through Java mapping

manikandan_shanmugam3
Active Participant
0 Kudos

Hi All,

I have a requirement to append unique identifier (Identifier will differ each box) in payload which will not be sent through sender,I am using Java Mapping for message transformation hence need to know how to accomplish the requirement.

Is it possible to call mapping parameters using Java mapping? or any other suggestion?

PI 7.4 Single Stack

Regards,

Mani

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Manikandan,

Recently I also faced the same requirement.

I have done this requirement. you can directly pass the parameters from Integration directory as many as you can.

here is the code snippet for that requirement.

public class MIME_CIF extends AbstractTransformation

{

  public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException

  {

  try

  {

  //Info message is added to trace.

  getTrace().addInfo("JAVA Mapping Called");

            InputStream inputstream = transformationInput.getInputPayload().getInputStream();

           

            OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();

          --------------------------

               String paramS = transformationInput.getInputParameters().getString("systemid");

               SOP("<Identity>" + paramS + "</Identity>");

          ------------------

}

}

Please let me know if you need any further information or clarification...

stefan_grube
Active Contributor
0 Kudos

of course. if your method declaration is

public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException

then you can call your mapping parameter like this:

in.getInputParameters().getString("myParameter");

Javadoc

former_member184720
Active Contributor
0 Kudos

Why do you want to access mapping parameters for generating unique identifier?

Just take the message ID and append a counter at the end for each segment which makes it unique.

However, if you are talking about parameterized java mapping then refer below blogs

Parametrized Java Mapping in PI 7.1 - Process Integration - SCN Wiki

Former Member
0 Kudos

Hi Manikandan,

A similar issue happens in the case of IDocs, where whenever we have similar segment names, we use qualifiers in order to make each of the repeating segment unique.

In your current case it is XML, so please add a new field (lets say FLD) in each of the repeating segments. In order to distinguish amongst repeating segments, the value of FLD in each case should be different.

Now, in graphical mapping in each segment map FLD to a unique constant, and you have a mapping for each of the other field(s) in that segment or that segment itself where you apply a condition "IF FLD equalS Constant[number] THEN the corresponding mapping should follow.

Regards,

Souvik