Accessing .NET Methods within Rules Composer
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 General > Accessing .NET Methods within Rules Composer




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

    Accessing .NET Methods within Rules Composer  
TimG


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


 
10-20-04 07:46 AM

Hi

I am trying to access the PMT function within the Microsoft.VisualBasic
.NET assembly but not quite sure how to do it.

the rule will be

if 1==1

then Field Element = PMT(?,?,?,?, 1)

I have set a Vocab fact but the rule never gets activated when using the
test policy utility within the Business Rules Composer

Regards

Tim





[ Post a follow-up to this message ]



    Re: Accessing .NET Methods within Rules Composer  
Matt Milner


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


 
10-20-04 12:47 PM

You'll need to assert an instance of whatever class the PMT function is in.
For the rules composer, this means creating a class that implements
IFactCreator.  For runtime execution, it just means passing in an instance
of that class (even for static methods).

Matt


"TimG" <TimG@discussions.microsoft.com> wrote in message
news:C534E983-32D9-41DD-BD83-3EECCB5A716B@microsoft.com...
> Hi
>
> I am trying to access the PMT function within the Microsoft.VisualBasic
> .NET assembly but not quite sure how to do it.
>
> the rule will be
>
> if 1==1
>
> then Field Element = PMT(?,?,?,?, 1)
>
> I have set a Vocab fact but the rule never gets activated when using the
> test policy utility within the Business Rules Composer
>
> Regards
>
> Tim







[ Post a follow-up to this message ]



    Re: Accessing .NET Methods within Rules Composer  
TimG


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


 
10-21-04 07:47 AM

Hello Matt

I'm still a litle confused on how to implement this, do I create a class

a) Implements ICreateFactor
b) Contains a function to call  VB PMT

Then

Within the rules composer (for test policy purposes only)

a) Assert the class
b) Assign an xml element with the returned variable  from the class pmt
function

Can you point me in the right direction (any good doco on this ) ?

Regards

Tim
"Matt Milner" wrote:

> You'll need to assert an instance of whatever class the PMT function is in
.
> For the rules composer, this means creating a class that implements
> IFactCreator.  For runtime execution, it just means passing in an instance
> of that class (even for static methods).
>
> Matt
>
>
> "TimG" <TimG@discussions.microsoft.com> wrote in message
> news:C534E983-32D9-41DD-BD83-3EECCB5A716B@microsoft.com... 
>
>
>





[ Post a follow-up to this message ]



    Re: Accessing .NET Methods within Rules Composer  
Sukesh Shetty


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


 
10-21-04 12:47 PM

implement IFactCreator, a sample is available in the documentation "Creating
a Fact Creator". GAC this assembly in which u have this newly created class.
This factcreator is only for Test Policy and not the orchestration.

On the test policy screen use the "add" button in the lower part of the
screen select the implemented class. For the xml message use add instance to
specify the xml instance you want to test with.

In the orchestration, in the scope of "call rules" shape create a variable
of type the class to which the PMT function belongs eg. objPMT . use a
expression editor before the call rules shape. Instantiate the class to the
variable
objPMT = new classPMT();

Now pass this variable as a parameter to the policy using the configure
policy option of the call rules shape. Also pass the xml message and any
other parameters that you use in the policy.

Sukesh.

"TimG" wrote:
[vbcol=seagreen]
> Hello Matt
>
> I'm still a litle confused on how to implement this, do I create a class
>
> a) Implements ICreateFactor
> b) Contains a function to call  VB PMT
>
> Then
>
> Within the rules composer (for test policy purposes only)
>
> a) Assert the class
> b) Assign an xml element with the returned variable  from the class pmt
> function
>
> Can you point me in the right direction (any good doco on this ) ?
>
> Regards
>
> Tim
> "Matt Milner" wrote:
> 





[ Post a follow-up to this message ]



    Re: Accessing .NET Methods within Rules Composer  
Matt Milner


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


 
10-21-04 10:51 PM

The fact creator simply creates an instance of the class that contains the
VB PMT function and returns that instance.  It "creates the fact"
essentially.  This is only for testing in the composer.  In an
orchestraiton, you'll need a variable of the type of this class, use an
expression shape to create a new instance, and then specify your variable in
the call rules shape.

So now you can have your action for your rule set an xml value equal to the
return of this method call.

matt


"TimG" <TimG@discussions.microsoft.com> wrote in message
news:6837E0CE-4D6C-4162-A495-D04FE57A565D@microsoft.com...[vbcol=seagreen]
> Hello Matt
>
> I'm still a litle confused on how to implement this, do I create a class
>
> a) Implements ICreateFactor
> b) Contains a function to call  VB PMT
>
> Then
>
> Within the rules composer (for test policy purposes only)
>
> a) Assert the class
> b) Assign an xml element with the returned variable  from the class pmt
> function
>
> Can you point me in the right direction (any good doco on this ) ?
>
> Regards
>
> Tim
> "Matt Milner" wrote:
> 







[ Post a follow-up to this message ]



    Re: Accessing .NET Methods within Rules Composer  
TimG


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


 
10-22-04 01:46 AM

Thanks guys for putting me on the right track, using the test policy works,
it should be pretty simple to implement it in the orchestration

Tim

"Matt Milner" wrote:

> The fact creator simply creates an instance of the class that contains the
> VB PMT function and returns that instance.  It "creates the fact"
> essentially.  This is only for testing in the composer.  In an
> orchestraiton, you'll need a variable of the type of this class, use an
> expression shape to create a new instance, and then specify your variable 
in
> the call rules shape.
>
> So now you can have your action for your rule set an xml value equal to th
e
> return of this method call.
>
> matt
>
>
> "TimG" <TimG@discussions.microsoft.com> wrote in message
> news:6837E0CE-4D6C-4162-A495-D04FE57A565D@microsoft.com... 
>
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:44 PM.      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