[rules-users] Drools Flow Trigger process by ruleset

David Sinclair dsinclair at chariotsolutions.com
Sat Mar 14 12:22:55 EDT 2009


Garrett,

You have access to the ProcessContext from the RHS side of a rule via the
kcontext variable. To start a process from the RHS, u can use the following
code.

kcontext.getKnowledgeRuntime().startProcess("proceeeFoo");


On Sat, Mar 14, 2009 at 11:59 AM, Garrett Conaty <garrett at conaty.net> wrote:

> Kris,
>
> Thanks for the advice on this.  Is it possible for the constraint of type
> 'rule' to be a link to an existing rule?  This would preserve all the
> goodness of being able to be viewed by analysts in Guvnor, use DSLs, etc.
>
> Alternatively, as you mentioned that internally Drools, translates this
> form to my 2nd option, is there an example that shows a rule with the RHS
> starting the process?
>
> Thanks,
> Garrett
>
> On Mar 2, 2009, at 5:34 AM, Kris Verlaenen wrote:
>
>  Garrett,
>>
>> The 3rd option you describe is currently possible in the core engine,
>> however support has not yet been added to the graphical designer for this.
>> You can however manually add it in the XML directly for now.  If you look at
>> the XSD it should look something like this:
>>
>> <start id="1" name="Start" >
>> <triggers>
>>  <trigger type="constraint" >
>>    <constraint type="rule" dialect="mvel" >p:Person()</constraint>
>>    <mapping type="in" from="p.getName()" to="SomeVar" />
>>    <mapping type="in" from="&quot;SomeString&quot;" to="SomeOtherVar" />
>>  </trigger>
>> </triggers>
>> </start>
>>
>> As you can see you can also specify additional parameters (that are passed
>> in as variables to the process instance), either by relating them to a
>> parameter of the rule or by specifying an explicit value.
>>
>> Note that it is internally simply translated to your 2nd option.
>>
>> We'll try to add the editor for this property for the Drools.5.0.0.GArelease.
>>
>> Kris
>>
>> ----- Original Message ----- From: "Garrett Conaty" <garrett at conaty.net>
>> To: "Rules Users List" <rules-users at lists.jboss.org>
>> Sent: Saturday, February 28, 2009 2:51 AM
>> Subject: [rules-users] Drools Flow Trigger process by ruleset
>>
>>
>>  _______________________________________________
>>> rules-users mailing list
>>> rules-users at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090314/7d062ca5/attachment.html 


More information about the rules-users mailing list