|
Home > Archive > BizTalk Server General > October 2004 > Accessing .NET Methods within Rules Composer
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Accessing .NET Methods within Rules Composer
|
|
|
| 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
| |
| Matt Milner 2004-10-20, 7:47 am |
| 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
| |
|
| 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...
>
>
>
| |
| Sukesh Shetty 2004-10-21, 7:47 am |
| 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:
>
| |
| Matt Milner 2004-10-21, 5: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:
>
| |
|
| 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 the
> return of this method call.
>
> matt
>
>
> "TimG" <TimG@discussions.microsoft.com> wrote in message
> news:6837E0CE-4D6C-4162-A495-D04FE57A565D@microsoft.com...
>
>
>
|
|
|
|
|