BTDF / DeploymentFramework

The Deployment Framework for BizTalk is the most powerful and customizable, yet easy-to-use toolkit for deploying and configuring your BizTalk solutions.
MIT License
53 stars 24 forks source link

Issue: IncludeVocabAndRules not including rules #345

Closed tfabraham closed 6 years ago

tfabraham commented 6 years ago

Hi,

I am deploying a project and everything except policies is being deployed. In my .btdfproj file i have:

True True

And later when adding policies:

path_to_policy_folder path_to_policy_folder

The project builds without error, but no policies are deployed. In the output, there is nothing related to DeployBTRules, so it seems like it isn't even trying to deploy the rules.

Any help would be appreciated.

Thanks,

Dale

This work item was migrated from CodePlex

CodePlex work item ID: '10668' Vote count: '1'

tfabraham commented 6 years ago

[tfabraham@7/2/2014] The most likely cause of nothing happening is that it can't locate the XML files. Are you running this deployment within Visual Studio? Are you using a relative path in LocationPath?

tfabraham commented 6 years ago

[dalemac89@7/3/2014] Hi, thanks for the response.

Yes, I am building in Visual Studio via Tools -> Deployment Framework for BizTalk -> Deploy BizTalk Solution.

Yes, the LocationPath is relative, like so:

<RulePolicies Include="Property.Policy.xml">
      <LocationPath>..\$(ProjectName).Deployment\Policies\Localhost</LocationPath>
    </RulePolicies>

It is the exact same format that is used to load schemas, itineraries, etc, and they all work fine.

Thanks,

Dale

tfabraham commented 6 years ago

[dalemac89@7/3/2014] Sorry, I have another question, too.

If i wanted to preprocess the policy xml files before they are deployed, what would I need to do?

The policies contain some transport locations that will be different depending on the environment, so i'm wondering what the best way to handle that would be.

Thanks,

Dale

tfabraham commented 6 years ago

[tfabraham@7/7/2014] The preprocessing question has been discussed here.

Are the policies at least being published, if not deployed? You should see the DeployVocabAndRules target executing after ImportBindings.

tfabraham commented 6 years ago

[dalemac89@7/8/2014] Hi Tom,

No, the policies are not being published to the database. There is no DeployVocabAndRules at any point of the process during output. It is as if it isn't being invoked for whatever reason.

Thanks,

Dale

tfabraham commented 6 years ago

[tfabraham@7/8/2014] I'm making the assumption that you are using a stock, unmodified BTDF v5.5, and that you're on at least BizTalk 2010.

Please add this to your .btdfproj near the end and capture the results.

<Target Name="PreDeployVocabAndRules" AfterTargets="ImportBindings">
  <Message Text="IncludeVocabAndRules = '$(IncludeVocabAndRules)'" />
  <Message Text="RulePolicies = '@(RulePolicies)'" />
  <Message Text="RuleVocabularies = '@(RuleVocabularies)'" />
  <Message Text="RulePoliciesQualified = '@(RulePoliciesQualified)'" />
  <Message Text="RuleVocabulariesQualified = '@(RuleVocabulariesQualified)'" />
</Target>
tfabraham commented 6 years ago

[dalemac89@7/9/2014] Hi Tom,

I re-exported the policies from the BizTalk Admin Console and then it magically started working. I can only assume the XML markup was malformed for some reason. I would have though incorrect markup would have thrown an error though.

Anyhow, it is solved now. Thanks for the suggestions and support.

Dale

tfabraham commented 6 years ago

[dalemac89@7/9/2014] From one BRI issue to another.

Now that the policies are being built into an MSI, I tried to deploy to the server and it failed. Tried it on the local and it fails, too.

The policies are being exported into one policy file using the biztalk admin console. I haven't started pre-processing them yet. This is the error I get:

 Information: Adding resource (-Type="System.BizTalk:Rules" -Luid="RULE/ESB.EndPointInfo/1.0") to application "UoL.ESB"...
  Information: Validating resources (count=1)...
  * Validating resource (-Type="System.BizTalk:Rules" -Luid="RULE/ESB.EndPointInfo/1.0")...
  Information: Found the rules store SERVER="DALE-BIZTALK-PC" and DATABASE="BizTalkRuleEngineDb".
  Information: Finding the rule set name="ESB.EndPointInfo" and version="1.0"...
EXEC : error : Failed to add resource(s). [C:\Users\dale-biztalk\Documents\Visual Studio 2012\Projects\UoL.ESB\Main\UoL.ESB\Deployment\Deployment.btdfproj]
  Validation failed for 1 resource(s).
  The rules policy "ESB.EndPointInfo" with version 1.0 is not found in the rule store. Please select existing policy.

Upon checking the re_vocabulary table on BizTalkRuleEngineDb the vocabilaries are there as they should be.

I have checked the permissions on the database and they are all fine. I have tried exporting the policies individually and adding them to the deployment config individually. Google doesn't give any real insight into this error.

Any ideas?

Thanks,

Dale

tfabraham commented 6 years ago

[dalemac89@7/9/2014] Here is the PreDeployVocabAndRules target:

PreDeployVocabAndRules:
  IncludeVocabAndRules = 'True'
  RulePolicies = 'UoL.ESB.Policies.ALL_POLICIES.xml'
  RuleVocabularies = 'UoL.ESB.Vocabularies.xml'
  RulePoliciesQualified = '..\UoL.ESB.Deployment\Deployment\Policies\Original\UoL.ESB.Policies.ALL_POLICIES.xml'
  RuleVocabulariesQualified = '..\UoL.ESB.BRE\UoL.ESB.Vocabularies.xml'
UndeployVocabAndRules:
  Populating metadata in ItemGroup from policy/vocabulary files content...
    Working on '..\UoL.ESB.Deployment\Deployment\Policies\Original\UoL.ESB.Policies.ALL_POLICIES.xml'...
      Added item [PolicyName:'ESB.EndPointInfo'; PolicyVersion:'1.0']
      Added item [PolicyName:'ESB.ContextInfo'; PolicyVersion:'1.0']
      Added item [PolicyName:'ESB.Itinerary'; PolicyVersion:'1.1']
      Added item [PolicyName:'ESB.TransformInfo'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.SMS.Student'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.SMS.StudentAddress'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.EMS.Floor'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.SMS.CompositeStudent'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.EMS.Location'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.ItinerarySelect'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.EMS.Space'; PolicyVersion:'1.0']
      Added item [PolicyName:'UoL.ESB.Policies.EMS.Property'; PolicyVersion:'1.0']
  Finished populating metadata in ItemGroup from policy/vocabulary files content.
  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "ESB.EndPointInfo" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'ESB.EndPointInfo' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "ESB.ContextInfo" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'ESB.ContextInfo' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "ESB.Itinerary" /ruleSetVersion "1.1" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'ESB.Itinerary' and version '1.1'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "ESB.TransformInfo" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'ESB.TransformInfo' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.SMS.Student" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.SMS.Student' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.SMS.StudentAddress" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.SMS.StudentAddress' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.EMS.Floor" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.EMS.Floor' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.SMS.CompositeStudent" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.SMS.CompositeStudent' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.EMS.Location" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.EMS.Location' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.ItinerarySelect" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.ItinerarySelect' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.EMS.Space" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.EMS.Space' and version '1.0'.
  Operation complete.

  "C:\Program Files (x86)\Deployment Framework for BizTalk 5.5\Framework\DeployTools\DeployBTRules.exe" /ruleSetName "UoL.ESB.Policies.EMS.Property" /ruleSetVersion "1.0" /unpublish /undeploy
  BizTalk Rules Engine Policy/Vocabulary Deployment Tool v5.5.100.0
  Copyright (C) 2005-2014 Scott Colestock, Thomas F. Abraham

  No published ruleset with name 'UoL.ESB.Policies.EMS.Property' and version '1.0'.
  Operation complete.

Why does it think that ESB.EndPointInfo, ESB.ContextInfo etc are policies? Surely they should be vocabularies?

Thanks

Dale

tfabraham commented 6 years ago

[tfabraham@7/9/2014] Yes, those are vocabularies and not ones that you should be deploying anyway. They're part of the ESB Toolkit Microsoft.Practices.ESB app deployment.

This might all be a result of how you're exporting the policies/vocabs. The Deployment Framework expects policies and vocabularies to be in separate XML files, never mixed. The feature was designed to work with the output of the Business Rules Engine Deployment Wizard, not the export feature in BizTalk Admin. Can you try again using the BRE Deployment Wizard to export, and update your .btdfproj accordingly?

tfabraham commented 6 years ago

[dalemac89@7/11/2014] Hi Tom,

Got it all working as expected now so thanks again. I've just made a small donation to show my gratitude.

Still have to figure out pre-processing the policy files, but i don't think that will be to much as an issue.

Thanks,

Dale

tfabraham commented 6 years ago

[tfabraham@7/11/2014] Thanks very much Dale! Did you end up re-exporting using the BRE Deployment Wizard?

I think everything necessary to set up the policy preprocessing is covered here, but if not just post a message on that thread.

tfabraham commented 6 years ago

[dalemac89@7/11/2014] Hi Tom,

It's the least I could do.

Yes, I exported the policies using the BRE Depolyment Wizard. There were some additional issues as some of the additional vocabularies were not installed on the server for some reason, but that was an easy fix.

I won't be looking at the policy preprocessing for the next week as i am off work, but it i run into trouble i will post on that thread as you suggested.

Thanks again,

Dale

tfabraham commented 6 years ago

[UnknownUser@7/11/2014]

tfabraham commented 6 years ago

Issue closed by tfabraham with comment Policy and vocab files must be exported by BRE Deployment Wizard instead of BizTalk Admin

Reason closed Not BTDF