[rules-users] Guvnor 5.5 being WIERD

Wolfgang Laun wolfgang.laun at gmail.com
Wed Jan 16 07:01:26 EST 2013


Do you expect the third inserted Object ("dum") to be the same as the
one you retrieve into variable "dum1"?

Then look at what you do in the consequence: it says "new Dummy" and
modifies this one, and this one isn't the one you inserted.

-W


On 16/01/2013, starfish15 <pooja.ghosh at accenture.com> wrote:
>
> Just giving you guys abt the code being used
>
> Rule
>
> 1.	|	rule "Rule One"
> 2.	|	    dialect "mvel"
> 3.	|	    when
> 4.	|	        Class(campaign == 1939506 )
> 5.	|	        Class1( CUR_FM_EOC_IN == "Y" )
> 6.	|	        Class1( GRP_TRANSPARENT_IN == "N" )
> 7.	|	        Class1( LEGAL_LANG_CD != "ES" )
> 8.	|	        Class( BUSUNIT_01_NO == "39" )
> 9.	|	    then
> 10.	|	        Dummy fact1 = new Dummy();
> 11.	|	        fact1.setAsset_41369( "Access 1" );
> 12.	|	        insert( fact1 );
> 13.	|	end
>
> Code
>
> KnowledgeBase kbase = readKnowledgeBase();
> StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
> final List<Command> cmds = new ArrayList<Command>();
> cmds.add(CommandFactory.newInsert(class, "class"));
> cmds.add(CommandFactory.newInsert(class1, "class1"));
> cmds.add(CommandFactory.newInsert(dum, "dum"));
> final ExecutionResults execResult =
> ksession.execute(CommandFactory.newBatchExecution(cmds));
> Dummy dum1 = (Dummy)execResult.getValue("dum");
> System.out.println("Asset Result Rule 0: "+dum1.getAsset_41369());
>
> The Sop gives a blank value. Though the value is being updated in the
> ACTION
> in the rule. What do you think I m missing???
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Guvnor-5-5-being-WIERD-tp4021569p4021571.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list