locked
Executing policy in orchrestration RRS feed

  • Question

  • I wrote a rule which is checking xml element value with  a constant value, and updates an element value another XML file.
    This rule is working fine on invoking the policy using the C# code, but I'm having problems in configuring with the call rule shape in orchrestration.

    I was able to configure the call rule shape in orchrestration where it checks for the XML element value with a constant value and updates another element of the same xml file.

    But I need help in configuring call rule shape in orchrestration where it checks for an element in one xml and updates the element of another XML file.so the final out folder should have only an updated XML file.

    I would like to have your assistent for upcoming days as I m developing a biztalk application and its my first project in biztalk and I'm pritty new to biztalk.
    Thanks in advance

     

    Wednesday, September 30, 2009 3:09 AM

Answers

  • I created instances of both messages (order and error) into the BRE orchestration. and then configure the order message with the Receive shape. and added both the messages to the BRE Call policy (inside call rule shape). But getting the following error on compiling the project

    error X2110: use of unconstructed message.

    Thanks for answering my question.

    You have to construct the message before passing it as a parameter or using it. You can do the following. Construct the message in a message assignment shape. From the schema create the default instance of the message and ignore the values in all the tags. Load the xml into a XmlDocument variable with LoadXML method. Then assign the xml document to the message.

    xmldocumentvar.LoadXml("<root><nodes></nodes></root>");
    mymessage = xmldocumentvar;
    Abdul Rafay http://abdulrafaysbiztalk.wordpress.com/ Please mark this answer if it helps
    • Marked as answer by bhshah Thursday, October 1, 2009 2:03 PM
    • Unmarked as answer by bhshah Thursday, October 1, 2009 2:03 PM
    • Marked as answer by bhshah Thursday, October 1, 2009 2:03 PM
    Thursday, October 1, 2009 6:40 AM

All replies

  • hi

    first test your policy at design time by passing your input file;when it is output is comming as per your requirement  then you need to deploy your policy;whateve parameter you have paassed at design time you need to pass same parameter to call rule shape;

    please let me know if you have any issue;
    Wednesday, September 30, 2009 4:59 AM
  • Here is simple BRE walkthrough inside Orchestration
    http://tech.ahmedshokr.com/2009/08/13/using-business-rules-composer-in-biztalk-server-2009-walkthrough/

    I had call rules configuration issue when i do the above sample so refered the below link
    http://zeetalks.wordpress.com/2008/05/11/30/


    Thanks, Raja
    Wednesday, September 30, 2009 6:33 AM
  • Also review the sample in the BizTalk Server SDK. It goes over exactly your scenario (passing XML into rules engine from orchestration and updating the XML):

    http://msdn.microsoft.com/en-us/library/aa559727(BTS.10).aspx


    Thiago Almeida - http://connectedthoughts.wordpress.com
    Wednesday, September 30, 2009 6:58 AM
    Answerer
  • Thanks for the reply.
    I was able to configure the above examples which does the validation and updates the same xml file.
    I'm having problem in configuring the below scenario.
    For example: business rule will be on A.xml and on validating the rule updates the B.xml, and the output folder should have B.xml
    Wednesday, September 30, 2009 1:59 PM
  • Do you have any field in the updated xml from which you can get notified that it is a validated XML? If not you can pass a variable to your policy which will return the status as true or false from the rule and then based on the return value you can output the other xml from your orchestration. For this you have to modify your policy a bit. For more help you can refer to MSDN link http://msdn.microsoft.com/en-us/library/aa561607(BTS.10).aspx
    Abdul Rafay http://abdulrafaysbiztalk.wordpress.com/ Please mark this answer if it helps
    Wednesday, September 30, 2009 2:17 PM
  • Are you constructing the B.xml message inside Orchestration? If not what kind of issue you had?
    Thanks, Raja
    Wednesday, September 30, 2009 2:17 PM
  • My input XML i.e A.xml is like

    <Order xmlns="urn:GeoAccess.Order" targetNamespace="urn:GeoAccess.Order">
      <Quantity>30</Quantity> 
    </Order>

    As per the rule, if the quantity is less than 50 than an error message should populate in the B.xml, for eg
    <?xml version="1.0"?>
    <errors>
      <messages>Insufficient ..</messages>
    </errors>

    This is working for me if I excute the policy using the C# code, but in my project I've to use the Call rule shape for executing policy.

    Wednesday, September 30, 2009 2:44 PM
  • There could be multiple ways to solve this problem.But to me easiest way to solve this is

    Declare a message variable in you .net class ( Gac it) and pass this variable to BR and same for Rule shape in Orch. So you will be passing XML file and message variable. Based on whatever condition you apply in the rule update the message variable and you can access the message variable in orchestration and can update your xml there.  Let me know if you find difficulty implementing it



    Thanks,
    Iftikhar


    Please mark this answer if this helps


    i.ahmad
    Wednesday, September 30, 2009 5:04 PM
  • Bhshah,

    Are you passing in instances of both messages (order and error) into the BRE call policy from the BizTalk orchestration? Try creating an instance of the error message in the orchestration, then configure it and the order message as inputs on the call rules shape.
    Thiago Almeida - http://connectedthoughts.wordpress.com
    Wednesday, September 30, 2009 6:45 PM
    Answerer
  • I created instances of both messages (order and error) into the BRE orchestration. and then configure the order message with the Receive shape. and added both the messages to the BRE Call policy (inside call rule shape). But getting the following error on compiling the project

    error X2110: use of unconstructed message.

    Thanks for answering my question.
    Wednesday, September 30, 2009 8:29 PM
  • You need to instantiate the error message before you can use it. This is done inside an "Construct Message" shape.

    There are some ways of doing this:

    http://biztalk.eliasen.dk/Orchestrations.aspx#orchestrations_constructI
    http://biztalk.eliasen.dk/Orchestrations.aspx#orchestrations_constructII
    http://biztalk.eliasen.dk/Orchestrations.aspx#orchestrations_constructIII
    http://biztalk.eliasen.dk/Orchestrations.aspx#orrchestrations_constructIV

    Good luck.

    eliasen, representing himself and not the company he works for.
    Three times MVP and three times MCTS in BizTalk.
    Blog: http://blog.eliasen.dk
    • Proposed as answer by eliasen Thursday, October 1, 2009 7:49 PM
    Wednesday, September 30, 2009 8:31 PM
  • Hi,
                  It seems a generic problem. From my point of view in the design time of the policy, we need to save, publish n deploy the policy. From the orchestration call rule shape, we need to select the copicy n pass the parameter to invoke the rule.

    Thanks
    Uttam
    Thanks & Regards Uttam
    Thursday, October 1, 2009 4:56 AM
  • I created instances of both messages (order and error) into the BRE orchestration. and then configure the order message with the Receive shape. and added both the messages to the BRE Call policy (inside call rule shape). But getting the following error on compiling the project

    error X2110: use of unconstructed message.

    Thanks for answering my question.

    You have to construct the message before passing it as a parameter or using it. You can do the following. Construct the message in a message assignment shape. From the schema create the default instance of the message and ignore the values in all the tags. Load the xml into a XmlDocument variable with LoadXML method. Then assign the xml document to the message.

    xmldocumentvar.LoadXml("<root><nodes></nodes></root>");
    mymessage = xmldocumentvar;
    Abdul Rafay http://abdulrafaysbiztalk.wordpress.com/ Please mark this answer if it helps
    • Marked as answer by bhshah Thursday, October 1, 2009 2:03 PM
    • Unmarked as answer by bhshah Thursday, October 1, 2009 2:03 PM
    • Marked as answer by bhshah Thursday, October 1, 2009 2:03 PM
    Thursday, October 1, 2009 6:40 AM
  • Thanks, it worked after  constructing the message in orchestraion.
    Thanks everybody for answering and giving suggestions.

    Thursday, October 1, 2009 2:06 PM