Fill Container Object in Java Mapping

Hi Everyone,
I use BPM and defined a container object of type integer. Now I want to fill this container object in Java Mapping. After I fill it in the next step there is a switch using the value of the container.
How can I fill the container in Java Mapping?
Thanks for the input.

How can I fill the container in Java Mapping?
Mandatory to fill the container in JAVA Mapping? If not then you can try the below:
1) Define a Container Object...already done
2) Let the JAVA Mapping create the required message....transformation step.
3) include a Container Operation before the Switch step (and after the Transformation)
4) Mode as Assign...Target will  be your Container Object (integer)....Expression will be the node from the output message of JAVA mapping.
Regards,
Abhishek.

Similar Messages

  • Creating the container Object In Java Mapping

    Hi,
    i I have a scenarion where i have to set some parameter in the COntainer from the Java Mapping.
    How can i get a reference to the current Container object from my Java Mapping . While using user defined function this object is already avaliable as a parameter and we do not have to create it .But in java mapping how do i get the current container object.
    regards
    Nilesh Taunk.

    Nilesh,
    sorry.. I think this is actually possible.
    In the setParameter()
    public static AbstractTrace trace;
    public void setParameter(Map param) {
              map = param;
              trace =
                   (AbstractTrace) param.get(
                        StreamTransformationConstants.MAPPING_TRACE);
    Likewise, in this method setParameter, you can get and set Container objects.
    I have shown how to use the TRACE .
    Sorry for the confusion
    Regards,
    Bhavesh

  • Using Container Object in Java Mapping

    Hi All,
    I need to use a Container object inside a Java Mapping, just like the one wich is used in the Graphical Mapping.
    Here is the scenario:
    I have an Interface Mapping with three steps on it.
    The first step is a Java Mapping just to put some info in the Container. The second step is a XSLT transformation that uses an XSLT file to transforms from IDOC to xCBL. The third step is another Java Mapping that get the info from the Container and insert in the xCBL.
    Does any one knows how to do it inside the Java Mapping Code? We cannot make modifications in the XSLT file because of some internal restrictions.
    Thanks,

    Hi,
    If you make the container variable is a part of your message (input of Java Mapping) then you can access as normal fields.
    Just have a look at these discussions-
    How to use Container Variable across Maps
    xi 3.0 - Using BPM variables in messages
    Hope this helps,
    Regards,
    Moorthy

  • Container Object in Java Class

    Hello ,
    I have a Mapping program using java class type (Java SAX in this case).  I need to access some Runtime constants and the mapping trace object.
    In message mapping is simple. We can use the container object that is pass to a UDF and the GlobalContainer Object.
    But how can I access the  Runtime constants  and mapping trace without a container object ?.
    Any ideas...?
    Thanks in advance.
    Yuvan D.

    in Your java mapping class
    you should import import com.sap.aii.mapping.api.*;
    public void execute(InputStream input, OutputStream output)
            throws StreamTransformationException {
            AbstractTrace trace = null;
            String RESULT = new String();
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
    trace.addInfo(doc.toString());
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

  • Container object in Message Mapping

    Hello
    I am having a scenario where I want to reuse the previous value of a map to calculate another value.For the same I tried container parameters in Message Mappings by using a simple Java function calling
    container.getGlobalContainer().setParameter("test","value");
    in another simple user defined java method I used container.getGlobalContainer().getParameter("test").
    But my target value is coming as null.
    Anybody knows how to use container methods to reuse values in Message Mappings??
    Thanks in advance.
    Regards
    Rajeev

    Hi,
    There is also another method by which you can use values across different functions.
    IN your Integration Builder, while you are in your Message Mapping, under the Design tab there is a small menubar.
    Choose the rightmost option which is called Edit Java Sections. Using this you can use global variables which have a scope of the entire mapping. That means you can use them anywhere in the mapping.
    Only remember to populate the variables with valid data before using them in other functions.
    Let me explain with an example.
    Once you click on Java sections, a smaller box opens up which has 3 fields.
    Under the first field called Global Variables we can give something like:
    String a;
    Under second field called Initialization Section we can give:
    a = " ";
    Now we can use this variable a in any UDF to store some value and this same variable can be used again to retrieve the value.
    This eliminates the need of using containers within the same mapping.
    Glad to be able to help.
    Regards,
    Kshitij

  • Get the value of Container element in message mapping

    Hi,
    Is it possible to read the value of container elements(bpm) in a UDF defined in message mapping. If yes, please tell me how?
    Thanks and regards,
    Siji

    Siji,
    Refer thread - Creating the container Object In Java Mapping
    Regards,
    Geetha

  • Container Element in the Mapping UDF

    Is there any way that to access the BPM container Element in the Mapping UDF. Can some one share the UDF code for this

    Hi,
    Refer BPM Container Element and Container in UDF Relation
    BPM Container Element and Container in UDF Relation
    Creating the container Object In Java Mapping
    Thanks
    swarup

  • Issues in mapping objects from java to flex - using flex4

    Hi,
    I have a class in java which i want to send to flex4 using BlazeDS as middleware. There are a few issues that i am facing and they are:
    When sending the object across (java to flex), the properties with boolean data type having value as true gets converted to properties with value as  false. Even after setting the value to true it still comes as false on flex side. Can't understand why this is happening.
    When sending the list of object containing property with boolean data type, the object on flex side does not show those properties at all. As of there were no boolean properties in that object.
    Last but not the least, When sending List<ContractFilterVO> contractFilterVOs to flex using remote call, the result typecasted to ArrayCollection does not show the holding objects as ContractFilterVOs but as plain default Object though having all the properties send, except the boolean one mentioned in above points. Basically it is not able to typecast the objects in arraycoolection but the same objects gets typecasted when sent individually.
    In all the above points i am using Remote Service through BlazeDS for connectivity with Java. I have done a lot of this stuff in Flex 3 but doing it for the first time in flex 4, is there anything that Flex 4 needs specific. Below is the pasted code for reference purpose.
    Flex Object
    package com.vo
         [RemoteClass(alias="com.vo.ContractFilterVO")]
    public class ContractFilterVO{
         public function ContractFilterVO(){
         public var contractCode:String;
         public var contractDescription:String;
         public var isIndexation:Boolean;
         public var isAdditional:Boolean;
    * Rmote Part of code
    var remoteObject:RemoteObject = new RemoteObject();
    remoteObject.destination="testService";
    remoteObject.addEventListener(ResultEvent.Result,handleResult);
    public function handleResult(event:ResultEvent):void{
         var contarctFilterVOs:ArrayCollection = event.result as ArrayCollection; //Point 2&3 probelem, if list sent form java
         var contarctFilterVO:ContractFilterVO= event.result as ContractFilterVO; //Point 1 probelem, if only single Object of type ContractFilterVO sent form java
    Java Object
    package com.vo
    public class ContractFilterVO implements Serializable 
         public function ContractFilterVO(){
         private static final long serialVersionUID = 8067201720546217193L;
         private String contractCode;
         private String contractDescription;
         private Boolean isIndexation;
         private Boolean isAdditional;
    I don't understand what is wron in my code on either side, it looks syntactically right. It would be great anyone could help me point out my mistake here. Waiting for right solutions...
    Thanks and Regards,
    Jigar

    Hi Jeffery,
    Thanks for your reply, it did solve my query @ point 3 as well as point 2 where the objects in arraycollection were not geting converted and boolean properties did not appear when list of an objects were received. And hey, i did have public functions for properties defined java class, just forgot to mention here in post, sorry for that.
    The solution you gave was right, but than what if i have a VO which has multiple List of objects coming from Java, than i would have to create an instance of each type of object on flex side this is too tedious, is'nt it? Is there any better solution... out there.
    And jeffery do you some tricks up your sleeve for this Boolean issues to that i am facing in point 1... Still struggling with this one...
    Anyone out there would be more than welcome to point my mistake, if any and provide tips/tricks or solutions...
    Thanks again to Jeffery...
    Waiting for more solutions sooner...
    thanks and Regards,
    Jigar

  • Creation of additional attachment in Java Mapping

    Hello all,
    I want to use a Java Mapping with the functionality to create a second /attachment which I can send over email out?
    I don’t want to pick this file somewhere from the server, instead I want to fill the content of the additional attachment directly in the java mapping.
    I hope somebody knows the answer of my question.
    If its possible is there any kind of example??
    Many thanks for your help
    ilka

    hi Stefan,
    http://scn.sap.com/thread/1874962
    Regarding the comment in this thread, can you please tell me if you have faced any issue with creating output attachments. Right now, i have a message mapping in which i have written a udf to create attachments
    this message mapping is a multi mapping and the source is 0-unb. I have used a return as xml on the root message and pointed it to the udf after split by value.
    There are three root nodes in one of my cases, and when this goes through this mapping, there is 1 attachemnt each created with three main documents and submain documents. However, all the attachments contain details of the first root node itself where in actually it should be each main and submain document having a different attachment. Please find my udf below. Please let me know if you think it is wrong somewhere.
    udf :-
    GlobalContainer globalContainer = container.getGlobalContainer();
    OutputAttachments outputAttachments = globalContainer.getOutputAttachments() ;
    int flag =0;
    AbstractTrace trace = container.getTrace();
    String attachmentName = "";
    //for(int i=0;i<var1.length;i++){
    try
    var1=var1.replaceAll("><",">\n<");
    attachmentName = "attachment"+cnt;
    Attachment newopAttachment = outputAttachments.create((attachmentName), var1.getBytes("UTF-8"));
    outputAttachments.setAttachment(newopAttachment);
    trace.addInfo("newopAttachment"+newopAttachment);
    cnt=cnt+1;
    attachmentName ="";
    newopAttachment = null;
    var1="";
    catch (Exception e)
    trace.addInfo("ever reaching trace");
          e.printStackTrace(); 
    //result.addValue("1");  
    //result.addValue("1");  
    return "1";
    Input :-
    Messages
    Message1
    SBDH
    SBDH
    SBDH
    Each of the above SBDH, i have returned as xml and pointed to the udf after split by value
    Your help is highly appreciated.
    Regards,
    Ninu

  • Xerces for XSD 1.1 Validation not working in Java Mapping

    Hi Experts,
    We are trying to use XSD 1.1 (assertion feature) validation for the XML payload in a Java mapping program. But I am getting the following exception:
    java.lang.IllegalArgumentException: http://www.w3.org/XML/XMLSchema/v1.1 at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:186)
    This is happing for the statement:
    SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");
    The reason (apparently) is because it is not able to instantiate the class org.apache.xerces.jaxp.validation.XMLSchema11Factory , which is the Xerces implementation of the SchemaFactory class.
    I have tried following things so far -
    1. If I try to validate an xml against an xsd 1.1 schema in a standalone program, it works perfectly fine.
    2. If I try to deploy this whole functionality on to the server through an EAR (like an adapter module), there again it works.
    3. Also tried this before instantiating the SchemaFactory -
    System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/XML/XMLSchema/v1.1","org.apache.xerces.jaxp.validation.XMLSchema11Factory");
    4. I tried by creating the Imported Archive objects for all the Xerces jars that we require for validation, within the same SWCV, namespace. But still I get the same exception as above (IllegalArgumentException)
    5. The link [http://help.sap.com/saphelp_nw70/helpdata/en/b6/8097f5a5edea4f8dfc87ac87082b22/content.htm ] mentions that we need to place all the necessary jars at location <SAP_J2EE_Engine_install_dir>/cluster/server/bin/ext /. But even after placing the jars there, I get the same exception.
    I am not sure how we need to handle this. Has anybody faced a similar situation? Any suggestions?
    Regards,
    Sudheer

    Hi Stefan,
    Thanks for the reply.
    We are on PI 7.1 SP 06. The standard XML tools from jdk supports only XSD 1.0, as far as I know. And XSD 1.0 does not have the Assert feature (also known as, co-occurrence constraint). More details are provided here - [http://www.ibm.com/developerworks/library/x-xml11pt2/]
    To use XSD 1.1, we need a different implementation like Xerces-J. I am not sure how we can use it without external jars. I would like to mention again that I could achieve this by using an adapter module (EAR containing the jars), but I need to do this in Java Mapping (imported archive).
    Do you know how we can achieve this in any other way? Any other suggestions welcome.
    Thanks & Regards,
    Sudheer

  • Java Mapping of Adapter-Specific Message Attributes

    Hi!
    I've got a problem with the help.sap.com-example for the above mentioned task:
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        “http://sap.com/xi/XI/System/File”,
        “FileName”);
    String valueOld = conf.get(key);
    if (valueOld != null) {
        String valueNew = valueOld.replaceAll(“input”,”output”);
        conf.put(key, valueNew);
    The Container-class I  have doesn't offer the method getTransformationParameters(). Additionally, the method get() from class DynamicConfiguration doesn't accept a DynamicConfigurationKey-object. Finally: how do I instantiate the Container-object (I think it's stored in the Parameter-Map, but what's its name?).
    Thanks!
    BR
    Christian

    Hi Christian,
    Pls see these sap help links on the Java mapping.
    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/frameset.htm
    As you would see in the example shown in the link...you donot require a container object in case of java mapping(that is required when you are using the user defined functions)...
    here you can call the get() method from the map in the java mapping class....this map is set by the mapping runtime by calling the setParameter() method in your java mapping class.
    Thanks,
    Renjith

  • Java mapping for XSD Validation

    Hello,
    I have developed a Java mapping to validate an XML based on XSD.
    I works fine and generates a message with error details.
    I would like to create a report with all errors encountered during this Validation and to stop this message from being sent to the partner.
    But this Java mapping stops at first error encountered and generates an error message with first error only even though document has more errors further.
    Can anyone please let me know if there is an option to log all errors without allowing the message to go through?
    Thanks.
    Best Regards,
    Shweta

    Yes, as abhishek mentioned when you validate the instance document (XML) using standard parsers then they validate based on the spec provided in XSD and they stop at the first error. The link given using dom parser via java code will also stop at the first error.
    If you really want to validate the entire instance document then you might have to create a custom validator class which does validation for each and every fields and store it in an object like Vector or List or Map object.  Then when you throw exception you can retrieve that Map object  in the catch block and read all the individual error messages and display in log. This requires additional effort. In this case you dont rely on parser validation. Completely custom based.
    Example:
    Vector errorList = new Vector();
    if the field name is  SSN and if you see any alpha characters you add error for that field in the errorList
    If(SSN.matches("[a-zA-Z]")){
        do nothing
    }else{
        errorList.add("The fieldName SSN contains other than alpha characters");
    Like that you have to add error string mesg in the errorList object and return the errorList at the end.

  • ResultList and Container objects

    The Java ResultList and Container objects are used in SAP Mapping UDF's ...does anyone know which specific jar files contain these object definitions ?
    Thanks,
    Rod.

    For PI 7.0(3.0) you need the libraries: aii_mt_rt.jar, aii_map_api.jar, aii_utilxi_misc.jar
    For PI 7.1 you need the libraries: com.sap.xi.mapping.tool.lib_api.jar, com.sap.xpi.ib.mapping.lib.jar, com.sap.aii.utilxi.server.jar
    /people/stefan.grube/blog/2005/12/30/test-user-defined-functions-for-the-xi-graphical-mapping-tool-in-developer-studio

  • 1:n Transformation using JAVA Mapping Scenario

    Hi Frnds,
    I done a scenario using 1:n Transformation Scenario using XSLT,Graphical Mapping.
    But i want to develop scenario Using JAVA Mapping.
    Can anybody done the same scenario using JAVA Mapping share the links..
    Regards,
    Raj Sekhar

    You can use SAX parser for this
    firstly create a StringBuffer sb object which will store our target output
    when startDocument() gets called append the xml declaration in this method
    sb.append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
    sb.append("<Root>");
    next for the Test element you have your startElement() method called which will contain the name of your source tag i.e Test
    for this , you will need to set a variable boolean isTest to true which was initialised as a false value.
    in the characters method you will get the value present in this tag.
    test the variable isTest for true value.
    if it is true then append the following
    sb.append("<Test1>"name"</Test1>"); //name is the buffer passed in characters method
    sb.append("<Test2>"name"</Test2>");
    sb.append("<Test3>"name"</Test3>");
    at the end your endelement() will be called
    here reset the value of isTest to false.
    in your endDocument()
    sb.append("</Root>");
    lastly convert to byte[] and then to outputStream format
    Edited by: Progirl Progirl on Jul 4, 2008 2:00 PM

  • How to pass input parameter (parameterized mapping) to java mapping program

    Hello
    I have a question about the parameterized mapping with Java (PI 7.1).
    In the operation mapping (using Java-class) I defined a inputer parameter (string). I think I am supposed to retrieved the value using:
                    arg0.getInputParameters().getString("myInputParameterName");
    where arg0 is the TransformationInput object.
    However I am not able to get the value, I got runtime exception saying the inputer parameter doesn't exit.
    Then I figured out maybe I need to bind the OM input parameter to Java mapping parameter, just like in case of message mapping, you need to bind OM parameter to MM parameter. However there is no way to define input parameter for the java mapping program.
    Anybody has done java mapping with parameterized mapping?
    Anybody can give any hint for this?
    Thanks
    Jayson

    InputParameters params = container.getInputParameters();
    DynamicConfiguration conf = (DynamicConfiguration) params.getValue(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Edited by: Anand on Dec 10, 2008 4:13 PM

Maybe you are looking for

  • Print Preview in RFx does not show new Adobe Interactive Form

    Hello Experts, I am trying to assign a standard Adobe Interactive form as the output form for SRM RFQ.  I have carried out the following steps in customising under "Define Actions for Document Output". - Selected bid invitation Action Profile = BBP_P

  • FIR Maximum Frequency

    Hi, I try to design FIR filters with 501 coefficients (single symmetric coefficient set) an with max frequency > 650 MHz. Guess it should work because DSP48E1 max frequency is 740 MHz for 7-series -3 devices. Actually, it works fine if the number of

  • Document Splitting Function in 6.0 dectvt & reactvt

    Dear All, At our client site, some user with access to customisation, deactivated the Document Splitting by checking the Inactive Tick for the Company Code. This came to light after some days. This directly affected out Business area balance sheet. N

  • Images pixelated/distorted in ADE

    I just downloaded ADE, and everything seems to be working, except that the images are all distorted. You can actually see part of the images below the distortion, but the distortion consists of what appear to be pixelated, thick horizontal lines of v

  • Change the system status

    hi all, I want to chang the equipment system status to equipment at custome site, how to do this please guide me, thanks Amit ranjan