In my project i want Drools ( version 5.5.0.final) to execute specific rule flow group.
Is there a way to do this?
Use ruleflow. I tried it with Java AgendaFilters but the API is limited. Create a flow diagram that has your ruleflow-group node and start as process.
Related
I am currently looking into SAS Viya 3.4 to replace SAS 9.4.
Now I was curious to see the possibilities of the Environment Manager in scheduling Jobs and mantaining and creating Job flows. However, I noticed that I could only Drag and Drop Jobs in a flow and connect them with very few configurable options. Also as a trigger to start a Jobflow I was only able to select a time event. I am wondering if there are other trigger types to choose from. Like a Job will be triggered if a specific table exists or a file exists [or ...]. Neither did I see the possibility to trigger/start a job based on the return code of the previous job.
Also it does not seem to be smart enough to make sure two jobs don't access a library with write access at the same time.
I can't see how SAS Viya could replace a Job Orchestration Tool. However, I feel like the tool was built to replace such an Orchestration Tool. Did I miss something or is it just not possible to do so with the Environment Manager in SAS Viya?
Any help/insights is highly appreciated. I already searched through the documentation but could not find anything.. Maybe I was just looking at the wrong place?
Why 3.4 and not 3.5 (or Viya 4)?
If you want to use Viya with your own Job Orchestration software you can consider this tool (built by my team): https://cli.sasjs.io/job/
We deployed it on Jenkins for this customer: https://www.sas.com/en_us/news/press-releases/2021/july/sas-partnership-with-lloyds-list-intelligence.html
I have 2 drools file in the same package com.sample.order.rules
orders.drl and order-summary.drl. I want to process all the orders in orders.drl and then from the results of order.drl processing, create an order summary using order-summary.drl. I currently control the order of execution by setting all the saliences in order-summary.drl to -1. Is it possible to solve this problem any other way? The problem is the number of rules is increasing and adding salience to every rule in order-summary.drl just doesn't feel right.
It is possible to control the execution order of groups of rules with the attribute ruleflow-group, see examples from the docs. In general, the approach is:
Tag your related rules with a ruleflow-group attribute.
Create a BPMN Flow (a Business Process)
Associate each of your ruleflow-groups with a Business Process Task
Trigger your rules under a jBPM Process
This allows you to (optionally) only trigger your Summary steps when some conditions in the previous Orders step have been satisfied. I would suggest looking at the Mortgage_Process example provided by the Drools Business Central Showcase Docker image. To set up the KIE Execution Server API to test your rules and processes iteratively, see the docker-compose set up here.
Step 1
rule "order rule 1"
ruleflow-group "orders"
when
Order ( value > 10 )
then
insert ( new Shipment () );
end
rule "summary rule 1"
ruleflow-group "summary"
when
Shipment ()
then
// do stuff
end
Step 2
I am building a rule Engine in which I want to group rules in such a way that for a particular fact drools will not check for all the rules instead it will check for the rule in a specific group.
Is it possible to implement?
Yes. It is possible to implement, you have to implement a process with the rules you want to apply to the specific group, then you can implement a rule like this:
rule "start process if ..."
when
// Fact in specific group?
then
kcontext.getKieRuntime().startProcess("ProcessName");
end
I would recommend you to follow the official drools tutorial, specially the lesson 4: https://nheron.gitbooks.io/droolsonboarding/content/gettingStarted/lesson_4__ruleflow.html
They teach you how to do this step by step.
I need to assign a task to many groups in a alfresco worflow!Can anybody help me with a example?How to modify a model and share-workflow-form-config.xml to suport this option?Thank you in advence!
One way of achieving this is as below.
Alfresco supports concept of group inside group(subgroups).So you can assign task to that particular group and achieve your requirement.
Further more,for creating workflow there are 2 workflow engines which are widely used(activiti and jbpm).You can use any of them.
For creating workflow you will need to create below files.
Task Model(Defining Properties)
Process Definition(Defines Workflow)
Web Client configuration(Displaying properties in UI.It defines forms)
Context File(For injecting process definition and model file)
For more details on JBPM workflow you can find below link use full.
http://krutikjayswal-alfresco.blogspot.in/2014/04/jbpm-workflow-in-alfresco.html
In above blog, for activiti workflow change will be only in process definition file.
I have 7 workflow that need to execute; that need to run in certain order ? Is there any scheduling service for this in wf4 or any other approach i can use?
Ocean
If you need to run them sequentially in a certain order, why not just create another workflow and put all 7 of your workflows as activities in a top sequential activity?
If you create an activity that derives fron NativeActivity you can schedule child activities in any order you like. That is the closest thing to a "SchedulerService" I can think of.
However you have to know the activites you want to run at compile time. You can only arrange the order differently using this approach.
If you don't know which activities you want to use at compile time you could use a parent/child technique I showed on my blog WF4 How To Invoke a Child Workflow as XAML