BizTalk Business Rule for checking against list of values contained in .csv, xml, etc -
i'm new bre , new biztalk whole, may quite simple , evading me...
what i'd this: create business rule in bre takes input incoming message , checks see if value contained in message matches of values within specified set of values. sample message follows. <isfound>
field updated accordingly.
<n1:documenttemplate xmlns:n1="mynamespace"> <rootoid>2.16.840.1.113883.3.51.60.2.5</rootoid> <isfound>false</isfound> </n1:documenttemplate>
basically i'd match <rootoid>
node against list of values. i've created business match <rootoid>
against hardcoded value in conditions of business rule...just proof of concept learn basics of how use bre , call rule in orchestration.
i'm failing find way match against list of values beyond doing giant list of hard-coded ors in "conditions" of business rule. list of accepted values large enough doing bunch of ors not going work.
ideally, i'd have maintainable xml file full of acceptable <rootoid>
values check against within business rule.
i realize there way call database , read values table/column matching, i'd rather keep sql out of equation can little more self-contained.
one "equal" expression enough. rhs fact should vocabulary item. in case of xml type proper path pull values 1 one , cause multiple evaluations , respectively firing action if there's match. key remember: bre pattern matching engine.
the vocabulary convenient alias fact definition. let's create xml file following structure:
<options> <value>a</value> <value>b</value> <value>c</value> </options>
define vocabulary fact name: possiblevalues xpath selector: /options/value xpath field: .
then defining rule if currentvalue == possiblevalues cause 3 condition evaluations rhs yields 3 facts working memory. consequently, true fire rule (action). compare default definition bre creates when pick node xml schema assert 1 (first) fact:
xpath selector: /options/ xpath field: value
(namespaces omitted brevity)
at runtime pass xml document argument bre (whether in orchestration or in .net component depending on bre invocation context). @ design time testing have implement fact creator component (implements ifactcreator) provide instance of required arguments.
long-term facts (like 1 in question) better managed using custom fact retrievers. fact retriever .net component implements ifactretriever. see documentation details. inside fact retriever implementation load xml (from disk) , assert working memory typedxmldocument.
Comments
Post a Comment