BRE Policy deployment on production environment
- Hi,
I have created one business policy which consumes vocabularies. Vocabularies defined refers to the XSD schema from my project in the development environment.
If I try to export the policy created on my machine to other developers machine then I had to copy and paste the schema used to the location similar to the vocabulary definition’s reference path.
To remove this hurdle, I have added that schema to the BizTalk application so that BizTalk will drop that automatically without user intervention.
Now if I import MSI then my schema will be put in the installation directory,
PROBLEM IS HERE
I have same policy exported in xml file which points to the vocabulary path say C:\Myproj\Shema.xsd.
My MSI have already dropped schema in the installation path say C:\BizTalk Installation\MyBizTalkApp\Schema.xsd
Now before importing the policy on the production environment I need to change the biztalk application path with the path mentioned in the BRE composer.
I think this is very error prone to change the path manually. Is there any workaround so that path in the export file will be changed automatically using some inbuilt variables like %BIZTLK_INSTALL_PATH% something….
Regards, Nilesh Sarkate [Remember to click "mark as answered" when you get a correct reply to your question]- Changed TypeAndrew_ZhuMSFT, ModeratorMonday, November 09, 2009 2:40 AMno follow up
- Edited byNilesh D Sarkate Monday, November 02, 2009 10:35 AMPoor auto formatting by Microsoft
All Replies
- Hi Nilesh,
although policy has the pointer to schema physical location it is not necessary in production to have that schema in some physical location, if you deploy the schema to GAC it is enough.
KiranMP - Kiran, Thanks for quick reply.
My problem is with the path for SOURCE FACT. At the time of creation of vocabulary it has taken fixed path which is required to change after my project is installed through MSI. Pls suggest..
Regards, Nilesh Sarkate [Remember to click "mark as answered" when you get a correct reply to your question] - ok iam not clear about your requirement but you can write post installer script which will copy files from installer location to the location specified in policy.
KiranMP - Hi,
I agree with Kiran. From BRE perspective you don't need the schemas that your vocabulary is based on in production environment. The references to the source schema files are only used when you editing your rules in the BRE composer.
However I don't agree with Kiran the schema needs to be in the GAC. IMHO the XPATH statements are incorporated into the vocabulary and that is used to get and set the fields. If you use the schemas in orchestration or maps then of course they need to be in the GAC but that has nothing to do with the BRE.
What do you mean by "SOURCE FACT". It is still not completely clear to my why you need to reference the source schema in production.
HTH, Randal van Splunteren - http://biztalkmessages.vansplunteren.net - Please mark as answered if this answers your question. - yeah Randal is correct if you are just getting values then no need of them to be in GAC but if you are using in maps etc or trying to validate against shema then they should be in GAC.
thanks Randal for correcting.
KiranMP- Edited byKiran mp Monday, November 02, 2009 11:18 AMt
- Well I think my problem is not clearly defined so here are details--
I have created vocabulary named ABC. I am checking it with some value and if that value matches then I am changing another Vocabulary XYZ to true.
Here, vocabularies ABC and XYZ are the fields from the schema used from the project. The vocabularies are of type XML Document Element/Attribute.
So, While executing the business rule my policy checks the vocabularies (WHICH ARE REFERRING TO THE SCHEMA AS THEIR TYPE IS CHOSEN TO BE XML DOCUMENT ELEMENT. You can see the available types displayed on the NEW VOCABULARY DEFINITION WIZARD) and it doesn't find the schema there and throws exception. To avoid this i need to put the schema at some location.
You can create same situation by following steps
1. Create a Schema and add two elements to look like as
+ Root
+ Document
- MySampleType
- ProcessMessage
2. Open BRE composer and create the New vocabulary.
3. Add new definition Definition1 to newly created vocabulary.
4. Choose "XML Document Element or Attribute" as a new definition type, click next button
5. Now Click Browse and locate the schema created in step 1.
6. Select the element MySampleType from the schema and click Ok.
7. Select GET (@Bottom of window) and click finish.
8. Add another Definition i.e Definition2
9. Again Choose XML Document Element or Attribute click Next
10. Click Browse button and locate the schema as done in step 5.
11 Click Next and Finish.
HERE, i will be checking value of Definition1 to "ABC" and if it matches then will be setting value of Definition2 = true.
My definitions are of type XML Document Element or Attribute so if you observe the properties of definition then under Schema tag you could see the some path taken.
Obviously this path will not be there @production environment so i need to put the schema at some location where my rule can refer to the schema for vocabularies definitions Definition1 & Definition2.
Now I consume the vocabularies in my rule. Now when this rule is supposed to be moved to production environment then I will export the rule in xml file using rules deployment Wizard.
In same way I will export the vocabulary to xml.
My exported files contains the vocabulary definition which points to the schema @ SOME PATH. Now consider i am on the production environment and have the export files for Policy & Vocabulary.
After import vocabularies would be created with the SOME PATH in the export file.
PROBLEM:
I will be left with only two options in Production Environment .
1. In Production environment copy the schema used in policy at location mentioned in the export file.
2. Add the Schema as resource to the Biztalk project and before importing policy and vocabulary, change the path to the Biztalk project installation in the export files.
I have added my schema to the BizTalk application using BizTalk Admin Console. By doing this my schema will be dropped automatically in the projects installation folder now i need to change the path in the export files.
I have observed that while creation of MSI our added resources are put in some path. that path contained something like %BIZTALK_INSTALL% (i'm not sure about exact variable name).
My question here
Is there any workaround to mention the biztalk installation path while either exporting/importing the policy/vocabulary.
If anybody knows better deployment of rules consuming the schema in the production environment then plz share......
Regards, Nilesh Sarkate [Remember to click "mark as answered" when you get a correct reply to your question] - Hi Nilesh,
in this case there is no need of schema to be placed in physical location,
what do you mean by "You can see the available types displayed on the NEW VOCABULARY DEFINITION WIZARD) and it doesn't find the schema there and throws exception. To avoid this i need to put the schema at some location."
what error do you get
check if your input xml(typedxmldocument) is in correct format.
we decalre vocabilaries with xpath so in production it needs xpath to return value so that it executes this policy and there will not be any validation with schema(physical location not required only xpath is enough for policy to get fired)
KiranMP - Hi,
I agree with Kiran. The schema references are only used to contruct XPath queries during rule and/or vocabulary development in the BRE composer.
At runtime those xpahts are used to get/set the values in a XmlDocument.
HTH, Randal van Splunteren - http://biztalkmessages.vansplunteren.net - Please mark as answered if this answers your question. - Kiran, Randal,
Thanks for yourt valuable time to newbie in BizTalk 2009.
"You can see the available types displayed on the NEW VOCABULARY DEFINITION WIZARD) and it doesn't find the schema there and throws exception. To avoid this i need to put the schema at some location."
Above lines are not a problem; We could see several available types for the NEW VOCABULARY CREATION WIZARD. PLS IGNORE THIS AS IT IS PART OF STEP TO CREATE THE VOCABULARY DEFINITION.
Here, I'm checking the existance of node present in the xml file so that I have added EXISTS IN and what I know is that when I dragged the vocabulary, it created XPATH something exactly like following in policy as
Condition
- AND
/*[local-name()='iMedOneData' and namespace-uri()='http://iMedData.iMedData']/*[local-name()='ProcessMessage' and namespace-uri()=''] exists in i1.BTAHL7.Schemas.iMedData
- AND
/*[local-name()='iMedOneData' and namespace-uri()='http://iMedData.iMedData']/*[local-name()='Document' and namespace-uri()='']/*[local- name()='MySampleType' and namespace-uri()=''] exists in i1.BTAHL7.Schemas.iMedData
MySampleType is equal to "ABC"
THEN
- Actions
ProcessMessage true
Now this kind of policy I want to push to the production environment. I think we need to put the schema @ some location to work this. Please correct me if i am wrong.
I would really appreciate if any one could tell me how to ship this kind of policy to production environment.
Regards, Nilesh Sarkate [Remember to click "mark as answered" when you get a correct reply to your question] - no there is no need of schema this policy will check if ProcessMessage element exists and if MySampleType element value is equal to ABC then it will set the ProcessMessage element value to true.
so for you policy to get executed your input XML(typedxmldocument) must have these 2 elements and if condition is true then element value is set to true
to check if you policy is executing corretly or not create another rule which negate the above condition i.e.,
AND
/*[local-name()='iMedOneData' and namespace-uri()='http://iMedData.iMedData']/*[local-name()='ProcessMessage' and namespace-uri()=''] exists in i1.BTAHL7.Schemas.iMedData
- AND
/*[local-name()='iMedOneData' and namespace-uri()='http://iMedData.iMedData']/*[local-name()='Document' and namespace-uri()='']/*[local- name()='MySampleType' and namespace-uri()=''] exists in i1.BTAHL7.Schemas.iMedData
MySampleType is not equal to "ABC"
THEN
- Actions
ProcessMessage false
and I will confirm that there is no need to have physical schema to execute above policy
KiranMP - Sorry! I exported this policy which created xml file then i tried to import it on the another machine and consumed using Call Orchestration.
It throws exception and after observing the exception I've found that it was searching for the schema which was reffered by the vocabulary definition.
Its annoying now :( SOMEBODY PLS HELP
Regards, Nilesh Sarkate [Remember to click "mark as answered" when you get a correct reply to your question] - can you post the error
KiranMP

