none
HELPER CLASS

    Question

  • HI,

    I have created a helper class for addition of two integer values. I am calling that method in the orchestration message assignment shape like this.

    Message_OUT.c=Var_Add.add(Message_IN.a,Message_IN.b);

    In the message constructed i am selecting Message_OUT. When i am building i am getting error as Message_OUT is not constructed.


    Regards, vishal

    Sunday, May 21, 2017 3:02 PM

Answers

  • So, this probably has nothing to do with the Helper Class. 

    This error happens because of a control flow problem.
    Assuming Add() returns a variable compatible with Message_OUT, you first need to make sure this code is always executed.

    • Marked as answer by b vishal Monday, May 22, 2017 4:43 AM
    Sunday, May 21, 2017 10:25 PM
    Moderator
  • Hi, This has nothing to do with the helper class, what you need to do is to CONSTRUCT the ot message before you can od any assignment of values in the message. There can be two ways to accomplish this.

    1) Create a dummy map which would map the details from the input to the output map just enough to create the entire structure of the output message.

    2) Go to the output schema,>Generate its instance.>Remove all the values assigned by default to the nodes

    Create a variabl xmlDoc in the orchestration of type System.Xml.XmlDocument. Use following code

    xmlDoc= new System.Xml.XmlDocument();
    xmlDoc.LoadXml("Load the string of the output message generated by Generate Instance");
    //In MEssageAssignment Shape
    OutputMessage=xmlDoc;
    
    //Also check the message in the construct shape
    


    Mandar Dharmadhikari

    • Marked as answer by b vishal Monday, May 22, 2017 4:45 AM
    Sunday, May 21, 2017 11:56 PM
    Moderator

All replies

  • So, this probably has nothing to do with the Helper Class. 

    This error happens because of a control flow problem.
    Assuming Add() returns a variable compatible with Message_OUT, you first need to make sure this code is always executed.

    • Marked as answer by b vishal Monday, May 22, 2017 4:43 AM
    Sunday, May 21, 2017 10:25 PM
    Moderator
  • Hi, This has nothing to do with the helper class, what you need to do is to CONSTRUCT the ot message before you can od any assignment of values in the message. There can be two ways to accomplish this.

    1) Create a dummy map which would map the details from the input to the output map just enough to create the entire structure of the output message.

    2) Go to the output schema,>Generate its instance.>Remove all the values assigned by default to the nodes

    Create a variabl xmlDoc in the orchestration of type System.Xml.XmlDocument. Use following code

    xmlDoc= new System.Xml.XmlDocument();
    xmlDoc.LoadXml("Load the string of the output message generated by Generate Instance");
    //In MEssageAssignment Shape
    OutputMessage=xmlDoc;
    
    //Also check the message in the construct shape
    


    Mandar Dharmadhikari

    • Marked as answer by b vishal Monday, May 22, 2017 4:45 AM
    Sunday, May 21, 2017 11:56 PM
    Moderator