Saturday 28 July 2012

To Promote Property in Pipeline Component

Steps to Promote Property in Pipeline Component:
1. First, Create an element in Property Schema with Property schema base value as “MessageDataPropertyBase”
(We are not associating this element with any Document schema and want to promote the value in Pipeline so that any document schema can use this Promoted Property).
Eg:
Property Schema
2. In Pipeline component, we can promote property in execute method of Icomponent Interface.
//IBaseMessage pInMsg
We want to promote property “UserName” and assign value “xyz” to it
//Second element in method is target Namespace of property Schema


pInMsg.Context.Promote(“UserName”,”Http://Test”,”xyz”)
return pInMsg;  //Returning value from Pipeline 


That’s it. This would promote property UserName in message context.
There is also a similar method called Context.Write  


pInMsg.Context.Write (“UserName”,”Http://Test”,”xyz”)


Difference between Context.Promote and Context.Write is using Context.Promote property is promoted in context of message and it can be used in Orchestration and at port level for routing.
But in Context.Write property is not promoted in message context and it can only be used in orchestration (like Distinguish property)

No comments:

Post a Comment