Rules "if one of element of this array has ... "
by Maxime Terrettaz
Hi,
I have OUL_R21 facts which have a array of OUL_R21_ORDER_OBSERVATION
objects.
OUL_R21_ORDER_OBSERVATION object has a array of OUL_R21_OBSERVATION.
OUL_R21_OBSERVATION object has a array of OUL_R21_OBSERVATION_RESULT.
And OUL_R21_OBSERVATION_RESULT has a OBX child.
I want to add the number one in my global list if one of all OBX has
abnormalFlags.value in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )
if
(OUL_21.ORDER_OBSERVATIONS[*].OBSERVATIONS[*].OBSERVATION_RESULTS[*].OBX.abnormalFlags.value
in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )) list.add(1);
Here is the rule in tring to create...
package com.xwave.drools
import com.xwave.hapi.hl7v2.model.v24.message.OUL_R21
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_ORDER_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION_RESULT
import java.util.ArrayList
import ca.uhn.hl7v2.model.v24.segment.OBX
global java.util.List list
/* Pour le chainage de tableau, il est obligatoire de le faire étape après
étape */
rule "Get All OBX"
dialect "mvel"
when
$labMessage : OUL_R21()
$orderObservation : OUL_R21_ORDER_OBSERVATION() from
$labMessage.ORDER_OBSERVATIONS
$observation : OUL_R21_OBSERVATION() from
$orderObservation.OBSERVATIONS
$observationResult : OUL_R21_OBSERVATION_RESULT() from
$observation.OBSERVATION_RESULTS
$obx : OBX() from $observationResult.OBX
then
insert($obx);
end
rule "Abnormals"
dialect "mvel"
when
$result : ArrayList(size > 0) from collect(OBX(abnormalFlags.value in (
'HH', 'LL', 'AA', 'H', 'L', 'A' )))
then
System.out.println("Abnormal result : " + $result);
list.add(1);
end
Could you please tell me the solution.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Rules-if-one-of-eleme...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
Rules "if one of element of this array has ... "
by Maxime Terrettaz
Hi,
I need to create a rule to verify is the value of a property.
I have OUL_R21 facts which have a array of OUL_R21_ORDER_OBSERVATION
objects.
OUL_R21_ORDER_OBSERVATION object has a array of OUL_R21_OBSERVATION.
OUL_R21_OBSERVATIONobject has a array of OUL_R21_OBSERVATION_RESULT.
And OUL_R21_OBSERVATION_RESULT has a OBX child.
I want to add the number one in my global list if one of all OBX has
abnormalFlags.value in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )
OUL_21.ORDER_OBSERVATIONS[].OBSERVATIONS[].OBSERVATION_RESULTS[].OBX.abnormalFlags.value
in ( 'HH', 'LL', 'AA', 'H', 'L', 'A' )
Here is the rule in tring to create...
<code>
package com.xwave.drools
import com.xwave.hapi.hl7v2.model.v24.message.OUL_R21
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_ORDER_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION
import com.xwave.hapi.hl7v2.model.v24.group.OUL_R21_OBSERVATION_RESULT
import java.util.ArrayList
import ca.uhn.hl7v2.model.v24.segment.OBX
global java.util.List list
/* Pour le chainage de tableau, il est obligatoire de le faire étape après
étape */
rule "Get All OBX"
dialect "mvel"
lock-on-active
when
$labMessage : OUL_R21()
$orderObservation : OUL_R21_ORDER_OBSERVATION() from
$labMessage.ORDER_OBSERVATIONS
$observation : OUL_R21_OBSERVATION() from
$orderObservation.OBSERVATIONS
$observationResult : OUL_R21_OBSERVATION_RESULT() from
$observation.OBSERVATION_RESULTS
$obx : OBX() from $observationResult.OBX
then
insert($obx);
end
rule "Anormaux"
dialect "mvel"
when
$result : ArrayList(size > 0) from collect(OBX(abnormalFlags.value in (
'HH', 'LL', 'AA', 'H', 'L', 'A' )))
then
System.out.println("Résultats anormaux : " + $result);
list.add(1);
end
</code>
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Rules-if-one-of-eleme...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
Problem with the Decision table
by Manikandan
Hi
Below is the code i use to run the rules in the decision table. I am
inserting the empty even object into the session but i still get the "Cannot
be resolved issues". I have attached my decison table as well. Am new to
DRools, so please help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
DecisionTableConfiguration dtableconfiguration = KnowledgeBuilderFactory.*
newDecisionTableConfiguration*();
dtableconfiguration.setInputType( DecisionTableInputType.*XLS* );
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.*newKnowledgeBuilder*();
kbuilder.add( ResourceFactory.*newClassPathResource*(
"RFC36877ScenarioDT.xls",
getClass() ),
ResourceType.*DTABLE*,
dtableconfiguration );
*if* ( kbuilder.hasErrors() ) {
System.*err*.print( kbuilder.getErrors() );
*return* -1;
}
KnowledgeBase kbase = KnowledgeBaseFactory.*newKnowledgeBase*();
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
// typical decision tables are used *statelessly
*
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
//now create some test data
Input input = *new* Input();
System.*out*.println("creating the event...");
BusinessEvent event = *new* BusinessEvent();
ksession.execute( Arrays.*asList*( *new* Object[]{input, event} ) );
System.*out*.println( "Business events " + event.getEvents());
*return* 0;
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks
Manikandan
14 years, 6 months
4th International Workshop on Event-Driven Business Process Management
by Adrian Paschke
[ our apologies should you receive this message more than one time ]
4th International Workshop on Event-Driven Business Process Management
collocated with BPM 2010
Hoboken, NJ, USA from September 13-16, 2010
http://www.bpm2010.org/conference-events/workshops/edbpm10/
Introduction
--------------------------
The recently coined term «Event-Driven Business Process Management» (EDBPM)
is nowadays an enhancement of BPM by new concepts of Service Oriented
Architecture (SOA), Event Driven Architecture (EDA), Software as a Service
(SaaS), Business Activity Monitoring (BAM) and Complex Event Processing
(CEP). In this context BPM means a software platform which provides
companies the ability to model, manage, and optimize these processes for
significant gain. As an independent system, CEP is a parallel running
platform that analyses and processes events. The BPM- and the CEP-platform
correspond via events which are produced by the BPM-workflow engine and by
the if distributed - IT services which are associated with the business
process steps. Also events coming from different event sources in different
forms can trigger a business process or influence the execution of a process
or a service, which can result in another event. Even more, the correlation
of these events in a particular context can be treated as a complex,
business level event, relevant for the execution of other business processes
or services. A business process arbitrarily fine or coarse grained can
be seen as a service again and can be choreographed with other business
processes or services, even between different enterprises and organizations.
Loosely coupled event-driven architecture for BPM provides significant
benefits:
* Responsiveness. Events can occur at any time from any source and
processes respond to them immediately, whenever they happen and wherever
they happen.
* Agility. New processes can be modeled, implemented, deployed, and
optimized more quickly in response to changing business requirements.
* Flexibility. Processes can span heterogeneous platforms and
programming languages. Participating applications can be upgraded or changed
without breaking the process model.
Workshop Themes
--------------------------
Authors are invited to submit novel contributions in the prior described
problem domain.
* Event-driven BPM: Concepts
o Role of event processing in BPM
o Business Events: types and representation
o Event stream processing in business processes
o Data- and event-driven business processes
o Evaluation/ROI of event-driven BPM
o Event-driven SOA
o EDA and BPM
o Real/time awareness in BPM
o Context in BPM
* Design-time CEP and BPM
o Modelling languages, notations and methods for event-driven BPM
o Event Patterns: Definition / Creation / Representation /
Learning
o BPMN and event processing
o Modelling unknown/similar events in business processes
o Modelling events in human-oriented tasks
o Semantics/Ontologies for event-driven BPM
o Publish/subscription mechanism and process modelling
* Run-time CEP and BPM
o Event pattern detection
o BPEL and event processing
o Reasoning about unknown/similar events
o Distributed event processing
o Dynamic workflows
o Ad-hoc workflows
* Applications/Use cases for event-driven BPM
o Event-driven monitoring/BAM
o Event-driven SLA monitoring
o Domains: Logistics, Automotive,
o Event processing and Internet of Services
Workshop Format
--------------------------
The Workshop is planned as a full-day event, including a keynote, paper
presentations, lightning talks, demos, posters, and a moderated, open
discussion with the clear goal of agreeing upon a research roadmap for
event-driven Business Process Management research, by taking into account
new challenges, described earlier.
A possible agenda:
* 9:00 9:30 Opening and Keynote
* 9:30 13:00 Paper Presentations
* 13:00 14:00 Lunch
* 14:00 15:00 Lightning Talks
* 15:30 17:00 Moderated Community Discussion: A Roadmap for
Event-driven Business Process Management Research
* 18:00 21:00 Poster and Demo Presentations and Get-Together
For the keynote, we aim at a high-profile speaker, who will give a rather
visionary view on the role of Future Internet for BPM and vice versa. For
the moderated community discussion, we will have senior experts from our
Program Committee and Experts from an industrial background. A clear
objective of that discussion is to yield a first draft of a respective
research agenda.
Important Dates
--------------------------
Deadline paper submissions: 21 May 2010
Notification of acceptance: 30 June 2010
Camera-ready papers: 25 July 2010
Workshops: 13 September 2010
Submission
--------------------------
The following types of submission are solicited:
* Long paper submissions, describing substantial contributions of novel
ongoing work. Long papers should be at most 12 pages long.
* Short paper submissions, describing work in progress. These papers
should be at most 6 pages long.
* Use case submission, describing results from an edBPM use case. These
papers should be at most 4 pages long.
Papers should be submitted in the new LNBIP format
(http://www.springer.com/computer/lncs?SGWID=0-164-7-487211-0). Papers have
to present original research contributions not concurrently submitted
elsewhere. The title page must contain a short abstract, a classification of
the topics covered, preferably using the list of topics above, and an
indication of the submission category (Long Paper/ Short Paper).
For submission, please visit
http://www.easychair.org/conferences/?conf=edbpm10.
Organizing Committee
--------------------------
Nenad Stojanovic
FZI Research Center for Information Technologies at the University of
Karlsruhe, Germany.
Haid-und-Neu-Str. 10-14
D-76131 Karlsruhe, Germany
nstojano (at) fzi.de
URI: http://www.fzi.de/ipe/mitarbeiter.php?id=483
Rainer von Ammon
CITT Regensburg/Germany
Konrad-Adenauerallee 30
D-93051 Regensburg, Germany
rainer.ammon (at) citt-online.com
Opher Etzion
IBM Research Lab in Haifa
OPHER (at) il.ibm.com
Adrian Paschke
Corporate Semantic Web, Free University Berlin, Germany and RuleML Inc.,
Canada
AG-CSW (Corporate Semantic Web)
Institute for Computer Sciences
Free University Berlin
Königin-Luise-Str 24/26
14195 Berlin, Germany
paschke (at) inf-fu-berlin.de
Program Committee
--------------------------
(see Website)
14 years, 6 months
rules not wrking
by Puneet duggal
frnds i have a rule
and its not working and i for checking i have put a Sop in my when but it
not prints the
Inside Area_SqFt_1_10-01-09_12-31-14
so how can we put SOP inside when clause.
rule "Area_SqFt_1_10-01-09_12-31-14"
date-effective "01-Oct-2009" date-expires "31-Dec-2014" salience 6
no-loop true
when
System.out.println("Inside Area_SqFt_1_10-01-09_12-31-14");
objectP2483 : Para_2483( (fid2335=="Block") && (fid2336==16) );
then
System.out.println("Area_SqFt_1_10-01-09_12-31-14");
objectP2483.setFid31003(new Double(497)); end
14 years, 7 months
Good To Have: TaskClient Interface
by tolitius
There is MinaTaskClient and BaseTaskClient, but no TaskClient interface.
That is why:
public void start( long taskId, String userId,
TaskOperationResponseHandler responseHandler )
public void stop( long taskId, String userId,
TaskOperationResponseHandler responseHandler )
public void release( long taskId, String userId,
TaskOperationResponseHandler responseHandler )
public void suspend( long taskId, String userId,
TaskOperationResponseHandler responseHandler )
public void resume( long taskId, String userId,
TaskOperationResponseHandler responseHandler )
public void skip( long taskId, String userId,
TaskOperationResponseHandler responseHandler )
public void delegate( long taskId, String userId, String
targetUserId,
TaskOperationResponseHandler responseHandler )
public void complete( long taskId, String userId, ContentData
outputData,
TaskOperationResponseHandler responseHandler )
...
is not a reusable approach (to get rid of Mina, and use something else [
JMS, DB, etc.. ] ). I think it would make sense to create an interface
defining the contract, and program to that interface.
Am I missing something?
Thank you,
/Anatoly
P.S. I know the whole approach is going to change to be pluggable in the
near future, but I find it strange there is no contract/interface that
defines a task lifecycle.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Good-To-Have-TaskClie...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 7 months
Re: [rules-users] rules not wrking
by John Peterson
If you really wanted to see your text string there, you might be able to
invoke a method that takes that text string and prints it and then
returns "true" in all cases. You'd most likely need to put it in an
Eval as suggested below.
>You can't directly use java code inside the LHS of a rule. You can
though
>use eval to call a java method inside your LHS. Also remember that you
don't
>have to use ; in the patterns.
>
>2010/4/30 Puneet duggal <duggalpunit(a)gmail.com>
>
>> frnds i have a rule
>>
>> and its not working and i for checking i have put a Sop in my when
but
>> it not prints the
>> Inside Area_SqFt_1_10-01-09_12-31-14
>> so how can we put SOP inside when clause.
>>
>> rule "Area_SqFt_1_10-01-09_12-31-14"
>>
>> date-effective "01-Oct-2009" date-expires "31-Dec-2014" salience 6
>>
>> no-loop true
>>
>> when
>>
>> System.out.println("Inside Area_SqFt_1_10-01-09_12-31-14");
>>
>> objectP2483 : Para_2483( (fid2335=="Block") && (fid2336==16) );
>>
>> then
>>
>> System.out.println("Area_SqFt_1_10-01-09_12-31-14");
>>
>> objectP2483.setFid31003(new Double(497)); end
>>
14 years, 7 months