2

What I want to do is this :

I am getting an xml as incoming. That has as "id" element. Now in a .net class library , I want to check that an entity with this id already exists in my db or not. If it already exists, the call is invalid.

How can I achieve this usin Biztalk Rule engine?

StuartLC
  • 104,537
  • 17
  • 209
  • 285
Dipti Mehta
  • 537
  • 3
  • 13
  • Do you need to know when this event happens or could you rather just handle this in your db insert code (and silently discard it)? – Filburt May 17 '11 at 08:45
  • ... and by db do you mean the MessageBox db or some other application db? – Filburt May 17 '11 at 08:47
  • Thanks filburt, but no, i do not want to handle it in db, there are several resaons, one of which is want to return a particular error code and error descripton , and this has to be configurable – Dipti Mehta May 19 '11 at 05:25

1 Answers1

1

The BizTalk rules engine is used to evaluate messages against rule sets. A rule set exists in a static stucture called a Policy, and there is no way to "enrich" the policy with calls to .NET components. Nor should there be.

If you need to invalidate a message based on some content via a database call do this in an orchestration before (or after) you call into the rules engine.

The rules engine is used for evaluating message content against rules based on static data or data based on other content in the message.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • 1
    Hi thicolour, are you sure ? Because vocabulary allows you to refer .net assemblies. And when i referred one, i was allowed to include methods that returned a "bool" value in the condition. but, i was not able to proceed further...going to give it another try just now, will keep you updated – Dipti Mehta May 19 '11 at 05:22
  • 2
    The .net assemblies refered to when you define a vocabulary are to support using .net classes as BizTalk messages, rather than to include a way to make calls to .net. However, I was wrong in my original response. There is a way to make DB calls from the rules engine by selecting "Database Table or Column" when you define a vocabulary item. This is detailed here: http://blogs.msdn.com/b/rgarg/archive/2009/04/23/using-biztalk-business-rules-engine-bre-with-database.aspx – tom redfern May 20 '11 at 15:17