none
Promoted Property in the Custom Pipeline Component. RRS feed

  • Question

  • Hello,

    I am a newbie in BizTalk Server. Today, I am learning about custom pipeline component. I have created a custom pipeline component and use for promoted property in the Pipeline. My application is successfully running. However, I have a few doubts which I would like to ask you. Please tell me.

    My Application - 

    Step 1. Created a custom pipeline component and promote property in the Execute message. (Stage type is ANY)
    Step 2. Register DLL in the GAC and paste a copy in the Pipeline Component folder.
    Step 3. Add a new project. Add a new pipeline and drag new component in the Decode stage.
    Step 4. Add a new Property Schema and add a field.

    P.S. I have skip few steps as I mentioned only important steps.

    Question 1. When I promote property, I use below method. 

    inmsg.Context.Promote("CustomContextPropertyName", "https://POC.CustomPipeline.CustomComponentImplement.PropertySchema1", _CustomContextPropertyName);
    • first Parameter is Property name (It should be match with the Property schema field.) Am I right?
    • Second Parameter is Property Schema Namespace (It should be match with the Property Schema's namespace) Am I right?
    • Third Parameter is value.(It is value of the property which we setting in the property.)  Am I right?

    This is my understanding.

    Question 2. I added custom pipeline component in the Decode stage. Is it right stage?

    Question 3. Can I add a new variable in the custom pipeline component which shouldn't be part of the Property Schema ? I mean, can I promote property in the custom pipeline component without creating a Property Schema?

    Thanks,
    Mohit Dahiya.


    Thanks, Mohit Dahiya


    Saturday, July 9, 2016 7:50 AM

Answers


    • first Parameter is Property name (It should be match with the Property schema field.) Am I right? YES
    • Second Parameter is Property Schema Namespace (It should be match with the Property Schema's namespace) Am I right? YES
    • Third Parameter is value.(It is value of the property which we setting in the property.)  Am I right? YES



    Question 2. I added custom pipeline component in the Decode stage. Is it right stage?

    Since you are promoting an arbitrary value in the context property(meaning a value that is not coming from message content), you can put it in any stage. If you were promoting a field from the message content, it should be done after the XMLDisassembler has executed in the Disassemble stage - so either Validate, or Resolve Party stage.

    Question 3. Can I add a new variable in the custom pipeline component which shouldn't be part of the Property Schema ? I mean, can I promote property in the custom pipeline component without creating a Property Schema?

    No, promoted properties need a property schema to work. When you say you are promoting a property on a message, it always means setting/promoting the value on a property schema field/property.

    Note that there are many out-of-the-box property schemas that ship with the Microsoft.BizTalk.GlobalPropertySchemas assembly(you will find them in the BizTalk.System application in Admin Console) - check in the Schemas node. You can use these properties directly in your pipeline code; for example to set custom WCF/SOAP headers in your outbound message, you would set the WCF.OutboundCustomHeaders property found in the "http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties" namespace.


    Thanks Arindam




    Saturday, July 9, 2016 8:03 AM
    Moderator
  • Hi Mohit,

    Question1: Yes, with the following method:

    MyIBaseMessage.Context.Promote("MyPropertyName", "http://MyPropertyNamespace", "MyValue");

    1st Argument is PropertyName

    2nd Argument is namespace of Property schema.

    3rd Argument is the value to be set.

    Question2: You can put this component in Any stage of receive pipeline.

    Question3: You have to use Property schema to promote context properties in pipeline. Following blog will serve the purpose:

    http://tech-findings.blogspot.in/2013/10/promoting-custom-context-property-using.html


    Rachit Sikroria (Microsoft Azure MVP)

    Saturday, July 9, 2016 8:15 AM
    Moderator

All replies


    • first Parameter is Property name (It should be match with the Property schema field.) Am I right? YES
    • Second Parameter is Property Schema Namespace (It should be match with the Property Schema's namespace) Am I right? YES
    • Third Parameter is value.(It is value of the property which we setting in the property.)  Am I right? YES



    Question 2. I added custom pipeline component in the Decode stage. Is it right stage?

    Since you are promoting an arbitrary value in the context property(meaning a value that is not coming from message content), you can put it in any stage. If you were promoting a field from the message content, it should be done after the XMLDisassembler has executed in the Disassemble stage - so either Validate, or Resolve Party stage.

    Question 3. Can I add a new variable in the custom pipeline component which shouldn't be part of the Property Schema ? I mean, can I promote property in the custom pipeline component without creating a Property Schema?

    No, promoted properties need a property schema to work. When you say you are promoting a property on a message, it always means setting/promoting the value on a property schema field/property.

    Note that there are many out-of-the-box property schemas that ship with the Microsoft.BizTalk.GlobalPropertySchemas assembly(you will find them in the BizTalk.System application in Admin Console) - check in the Schemas node. You can use these properties directly in your pipeline code; for example to set custom WCF/SOAP headers in your outbound message, you would set the WCF.OutboundCustomHeaders property found in the "http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties" namespace.


    Thanks Arindam




    Saturday, July 9, 2016 8:03 AM
    Moderator
  • Thank you Roy !!!!

    Thanks, Mohit Dahiya

    Saturday, July 9, 2016 8:12 AM
  • Hi Mohit,

    Question1: Yes, with the following method:

    MyIBaseMessage.Context.Promote("MyPropertyName", "http://MyPropertyNamespace", "MyValue");

    1st Argument is PropertyName

    2nd Argument is namespace of Property schema.

    3rd Argument is the value to be set.

    Question2: You can put this component in Any stage of receive pipeline.

    Question3: You have to use Property schema to promote context properties in pipeline. Following blog will serve the purpose:

    http://tech-findings.blogspot.in/2013/10/promoting-custom-context-property-using.html


    Rachit Sikroria (Microsoft Azure MVP)

    Saturday, July 9, 2016 8:15 AM
    Moderator
  • Thank you Rachit !!!!

    Thanks, Mohit Dahiya

    Saturday, July 9, 2016 8:19 AM
  • To be clear...

    Do not put the Pipeline Component Assembly in the %PipelineComponents% folder.

    This Wiki Article has all the details for deployment: http://social.technet.microsoft.com/wiki/contents/articles/26404.biztalk-server-deploying-custom-pipeline-components-in-biztalk-server-2006-and-higher.aspx

    You can Promote or Write a Context Property in any Stage of the Pipeline, but the component itself can only go in matching Stages.

    All Context Properties must be defined with a Property Schema.

    Also not that you have the option to Write a property as well.   The main difference being only Promoted Properties can be used for Routing and Correlation.

    Saturday, July 9, 2016 12:44 PM
    Moderator