Rules Engine
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server > Rules Engine




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Rules Engine  
Brent


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-09-04 10:50 PM

Hi,

I have a simple BizTalk Rules Engine Policy that checks for a
condition in a message, and if the contition exists, it calls a .net
class to add a field from the current message into an ArrayList().  If
I hardcode the parameter to the method as a string, all works fine.
As soon as a change the rule to pull out a field from the message and
pass that into the .net class method, I blow up in the rules engine.
I'm unable to get breakpoints to fire in BTSNTSvc.exe in the
non-working case, however they do fire in the case where I hardcode
strings.  Any ideas?

Thanks,
Brent.

Microsoft.RuleEngine.PolicyExecutionException: An exception occurred
inside the rule engine instance executing policy "KeywordMining". --->
Microsoft.RuleEngine. RuleEngineRuntimeMemberInvocationFailure
Exception:
An exception occurred when invoking class member
KeywordUtils.KeywordList.AddKeyword in assembly KeywordUtils,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=e01bf397f73ec37b.
---> System.ArgumentException: Object type cannot be converted to
target type.


at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)


at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean verifyAccess)


at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture)


at System.Reflection.MethodBase.Invoke(Object obj, Object[]
parameters)


at Microsoft.RuleEngine.Rete.ClassMemberMethod.Invoke(Object
classObject, Object[] parameters)


--- End of inner exception stack trace ---


at Microsoft.RuleEngine.Rete.Rete.ProcessException(Exception ex)


at Microsoft.RuleEngine.Rete.Rete.ExecuteInternal(Object facts,
Object data)


at Microsoft.RuleEngine.Rete.Rete.ProcessingLoop(Operation
operation, Object facts, Object data, EngineState nextState)


at Microsoft.RuleEngine.Rete.Rete.Execute(Object facts)


at Microsoft.RuleEngine.RuleEngine.Execute(Object facts)


at Microsoft.RuleEngine.Policy.ExecuteInternal(Object facts)


--- End of inner exception stack trace ---


at Microsoft.RuleEngine.Policy.ExecuteInternal(Object facts)


at Microsoft.RuleEngine.Policy.Execute(Object facts)


at Microsoft.RuleEngine.Policy.Execute(Object[] facts)


at RE.KeywordMinor.segment3(StopConditions stopOn)


at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s,
StopConditions stopCond, Exception& exp)

Microsoft.RuleEngine.PolicyExecutionException

Scoped@

KeywordMinor.??__scope0

KeywordMinor.Transaction_2

KeywordMinor.KeywordMinor

AdTarget.AdTarget

00000000-0000-0000-0000-000000000000





Microsoft.RuleEngine.PolicyExecutionException: An exception occurred
inside the rule engine instance executing policy "KeywordMining". --->
Microsoft.RuleEngine. RuleEngineRuntimeMemberInvocationFailure
Exception:
An exception occurred when invoking class member
KeywordUtils.KeywordList.AddKeyword in assembly KeywordUtils,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=e01bf397f73ec37b.
---> System.ArgumentException: Object type cannot be converted to
target type.


at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)


at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean verifyAccess)


at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture)


at System.Reflection.MethodBase.Invoke(Object obj, Object[]
parameters)


at Microsoft.RuleEngine.Rete.ClassMemberMethod.Invoke(Object
classObject, Object[] parameters)


--- End of inner exception stack trace ---


at Microsoft.RuleEngine.Rete.Rete.ProcessException(Exception ex)


at Microsoft.RuleEngine.Rete.Rete.ExecuteInternal(Object facts,
Object data)


at Microsoft.RuleEngine.Rete.Rete.ProcessingLoop(Operation
operation, Object facts, Object data, EngineState nextState)


at Microsoft.RuleEngine.Rete.Rete.Execute(Object facts)


at Microsoft.RuleEngine.RuleEngine.Execute(Object facts)


at Microsoft.RuleEngine.Policy.ExecuteInternal(Object facts)


--- End of inner exception stack trace ---


at Microsoft.RuleEngine.Policy.ExecuteInternal(Object facts)


at Microsoft.RuleEngine.Policy.Execute(Object facts)


at Microsoft.RuleEngine.Policy.Execute(Object[] facts)


at RE.KeywordMinor.segment3(StopConditions stopOn)


at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s,
StopConditions stopCond, Exception& exp)

Microsoft.RuleEngine.PolicyExecutionException





[ Post a follow-up to this message ]



    RE: Rules Engine  
Alvaro Miranda [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-09-04 10:50 PM

Based on the exception it seems the parameter passed is not a string. what
is the type of the field from the message?

--------------------[vbcol=seagreen] 
19:11:45 GMT)[vbcol=seagreen] 
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews2.google.com!no
t-for-mail[vbcol=seagreen] 

This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team






[ Post a follow-up to this message ]



    Re: Rules Engine  
Matt Milner


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-10-04 10:52 PM

I'd guess that the parameter type you want is a TypedXmlDocument instead of
a string. This type is defined in the business rule assembly.

If you want to test this out, set the parameter type to be "Object" and then
put a breakpoint on the first line.  You should be able to test in the
debugger and see what type the incoming object is.

Matt


"Alvaro Miranda [MSFT]" <alvarom@online.microsoft.com> wrote in message
news:BlFn6qlfEHA.1600@cpmsftngxa06.phx.gbl...
> Based on the exception it seems the parameter passed is not a string. what
> is the type of the field from the message?
>
> -------------------- 
> 19:11:45 GMT) 
>
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
>
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews2.google.com!no
> t-for-mail 
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> EBusiness Server Team
>







[ Post a follow-up to this message ]



    Re: Rules Engine  
Brent


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-10-04 10:52 PM

Hi,

I tried making the parameter type on my C# assembly an object, but I
still get the error and the breakpoints don't fire.  I do hit the
constructor for the object, I just never get a call to the method, it
seems the Rules Engine takes over and aborts before my method gets
called.

I checked the fact schema type and it is System.String the same as
what my original class expects.  In both cases (object or
System.String) I can hardcode the rule to a string constant, and all
works fine.

Any other ideas?

Thanks,
Brent.

"Matt Milner" <matt.milner@m3technologypartners dot com> wrote in message news:<#cUm5LufEHA.
3292@TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> I'd guess that the parameter type you want is a TypedXmlDocument instead o
f
> a string. This type is defined in the business rule assembly.
>
> If you want to test this out, set the parameter type to be "Object" and th
en
> put a breakpoint on the first line.  You should be able to test in the
> debugger and see what type the incoming object is.
>
> Matt
>
>
> "Alvaro Miranda [MSFT]" <alvarom@online.microsoft.com> wrote in messag
e
> news:BlFn6qlfEHA.1600@cpmsftngxa06.phx.gbl... 





[ Post a follow-up to this message ]



    Re: Rules Engine  
Alvaro Miranda [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-12-04 07:46 AM

Can you send the rule definition (and some sample message) and the method
definition?

--------------------[vbcol=seagreen] 
<BlFn6qlfEHA.1600@cpmsftngxa06.phx.gbl>
<#cUm5LufEHA.3292@TK2MSFTNGP10.phx.gbl>[vbcol=seagreen] 
21:11:01 GMT)[vbcol=seagreen] 
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!p
ostnews2.google.com!not-for-mail[vbcol=seagreen] 
news:<#cUm5LufEHA.3292@TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen] 
instead of[vbcol=seagreen] 
then[vbcol=seagreen] 
what[vbcol=seagreen] 

This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:59 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register