Setting a variable in the Rec. Pipeline for use in an Orch.

Home Page Forums BizTalk 2004 – BizTalk 2010 Setting a variable in the Rec. Pipeline for use in an Orch.

Viewing 1 reply thread
  • Author
    Posts
    • #12086

      I need to set a variable in a custom receive pipeline and use it within an orchestration.

      Within my custom receive pipeline, I am creating a GUID. I want to use this GUID for the rest of the processing of the incoming request. This GUID will be used for logging purposes.

      For example, when a request comes in, the GUID is created and a log is made which shows the file’s name, entry time, and step. During each major step within the Orchestration, I want to do the same thing. It allows me to perform message tracking and performance measurements.

      Is this possible?

      Thanks

      Scott

    • #12087

      I’m still doing something wrong.

      I created a distinguished field inside my Disassemble custom pipeline, within the Probe method.

      [code:1:6dcccc6188]public bool Probe(pContext, pInMsg) {

      pInMsg.Context.Write(\"CallChainID\", namespace, System.Guid.NewGuid());

      }[/code:1:6dcccc6188]

      Then within my Orchestration I try to reference the distinguished variable
      [code:1:6dcccc6188]msgTimeLoadXML.CallChainID[/code:1:6dcccc6188]

      But, it says that [quote:6dcccc6188]identifier \”CallChainID\” does not exist in \”msgTimeLoadXML\”; are you missing an assembly reference?[/quote:6dcccc6188]

      What am I doing wrong?

      Thanks

      Scott

      • #12088

        Hello.

        I have always done the promotion inside the Execute method like this:

        IBaseMessageContext myContect = inmsg.Context;
        myContect.Promote(this.ProElementName, this.ProNameSpace, this.ProValue);

        This will put the value into the context. You can need to get at the value inside the Orchestration like this:

        yourMessage(PropertyName);

        Also, make sure you have a Property Schema deployed with the correct namespace and element name.

        I have a sample that shows this in a little more detail include with the Limit Running Orchestration sample: https://www.biztalkgurus.com/Samples/Limit-Running-Orchestration.html

        Hope this helps.

        • #12089

          Yes, you can simply write this guid to the message context using the Write method. If you need to route on it, you would ensure it is promoted.

          • #12090

            I should have said that once your guid is in the message context, you will access it by using msg(yourpropname) in an expression shape. You will need to create a property schema that defines your property.

            • #12091

              Yes, as Stephen says – you want to promote or write the property by referencing your own property name and namespace. Don’t attempt to use the namespace for distinguished fields unless you have actually designated the corresponding portion of the schema as a distinguished field in the schema editor.

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.