Business Rules Vocabularies – Test for in a Range of Legal Values

Home Page Forums BizTalk 2004 – BizTalk 2010 Business Rules Vocabularies – Test for in a Range of Legal Values

Viewing 1 reply thread
  • Author
    Posts
    • #20301

       I’m finally trying to use vocabularies.  The goal would be to create a rule with a condition like this:

      channel = SpecialChannel

      SpecialChannel would be a vocabulary, where legal values are A, J, and X for example.

      I created a vocab called “SpecialChannel” as a “Constant”/ Set of Values, and put the three strings, A, J, and X.

      But when I try to use in a condition, it looks like this is just limiting the user to enter one of these three values.

      Is there any way to do this using the built-in features of vocab’s?  Maybe write C# helpers?

      Thanks,
      Neal 

        

       

    • #20306

       Neal,

      Are you trying to validate messages at runtime, or validate the values entered into business rules at design time.  In your scenario, the vocabulary would only limit the range of values that you could enter at design time.  If you want runtime validation, here are some things you could try:

      • Use a vocab that points at a C# helper that does the validation using constants defined in the code.
      • Create a database lookup vocab that validates the message against values in a database table.
      • Keep the constant vocab, and add a condition for each value in the list.

      Hope this helps!

      • #20316

         It’s not so much validation, as trying to almost put a shareable rule into a vocabulary. 

        We might have several rules that need to check if the status of a loan is “registered” or “locked”, and we will call that SendRegistrationToXYZ. But maybe tomorrow, we also want to send to XYZ when the status is “funded”.

        Based on what you said, I think the database lookup vocab fits the best.

        Thanks,
        Neal

        • #20351

           We decided to use the “contains” clause, which does “RegEx”.  We will probably put the RegEx expression in a vocabulary, for example:

          VocabGoodStates = “^TX$|OK$|FL$”;

          Then the rule will be:

          MyXMLState contains VocabGoodStates.

          Neal

      • #21582

        Greetings,

        I am having similar requirement to validate input data by looking into database. I want create Database Loopup Vocabulary. Can you provide me pointers as how to create Database Lookup Vocabuarly.

        Thanks in anticipantion

        J

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.