Flow - handling multiple events of the same kind
by Ed Staub
If the same event-node is triggered twice with different data, the same
variable will be recycled for the different data payloads. How does one
ensure that data is not lost?
My best guess is to follow the event node with a composite node, and copy
the top-level variables into the composite's variable scope in the first
sub-node of the composite. But I'm not sure whether I can guarantee that
the composite will be able to do that before the engine handles the second
event.
Suggestions?
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Flow-handling-multipl...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 7 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, 7 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, 8 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, 8 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, 8 months
Missing space when using DSL and Guvnor
by Doyel,Jeff
I am setting up a very simple example using a DSL and Guvnor. My DSL is as follows:
[when]Age is less than {age} years old=AgeFact(ageInYears < {age})
When I attempt to create a new Business Rule using the Guvnor I can select the above expression just fine and the sentence displays as expected. I then fill in the years with a numeric value (4) and validate. Upon validation I receive the following error.
[Age Test Rule] [ERR 101] Line 4:2 no viable alternative at input 'Age' in rule "Age Test Rule"
I then view the source and it looks like this.
rule "Age Test Rule"
dialect "mvel"
when
Age is less than 4years old
then
end
I noticed that there is no space between the '4' and the word 'years'. However, in my DSL sentence there is a space between {age} and years. Another interesting thing, if I enter the number 4 followed by a space in the Guvnor form then the rule validates correctly. Is this a bug or is it something I am doing wrong in my DSL?
Thanks,
Jeff
----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
14 years, 8 months
Error when trying to serialize session
by dmiller44
I'm getting the following stack when trying to serialize a session containing
one running process:
java.io.NotSerializableException:
org.drools.workflow.instance.impl.NodeInstanceFactoryRegistry
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
org.drools.RuleBaseConfiguration.writeExternal(RuleBaseConfiguration.java:191)
at
java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at
org.drools.common.AbstractRuleBase.writeExternal(AbstractRuleBase.java:204)
at org.drools.reteoo.ReteooRuleBase.writeExternal(ReteooRuleBase.java:185)
at
org.drools.impl.KnowledgeBaseImpl.writeExternal(KnowledgeBaseImpl.java:81)
at
java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421)
at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
The call is thrown from this line of code:
droolsOut.writeObject(session.getKnowledgeBase());
Is this a legitimate bug in Drools? Or is this because something in my
knowledge base is not serializable? The
"org.drools.workflow.instance.impl.NodeInstanceFactoryRegistry" is what is
confusing me if this is my issue or a Drools issue.
Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Error-when-trying-to-...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months