[rules-users] API's used for loading process in Eclipse
Esteban Aliverti
esteban.aliverti at gmail.com
Mon Jan 9 09:43:26 EST 2012
What is the content of com/simple/ProcessChangeSet.xml?
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com
2012/1/9 Manohar Kokkula <manohar.kokkula at tcs.com>
> Hi
>
> I am using Drool-5.2.0 final, Guvnor 5.2.0 final and
> designer-2.0-jboss.war in Drools-Guvnor.
> In Designer, I created simple process with start node, one task node, and
> end node. I made Task type of task node as "Script". I entered simple java
> code as System.out.print("Hi "); in the Script option of the task node.
> Sorry I dont know API's used for loading this process in Eclipse.
> So can any one tell me the API's used for loading this process in
> Eclipse.?
>
> I tried alot, but i am getting exceptions as:
>
> java.lang.NullPointerException
> at
> org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1090)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
> at com.simple.Mainclass.main(Mainclass.java:30)
>
>
> I am also sending my code:
>
>
> package com.simple;
>
> import org.drools.KnowledgeBase;
> import org.drools.agent.KnowledgeAgent;
> import org.drools.agent.KnowledgeAgentFactory;
> import org.drools.io.Resource;
> import org.drools.io.ResourceFactory;
> import org.drools.rule.FactType;
> import org.drools.runtime.StatefulKnowledgeSession;
>
> public class Mainclass {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
>
> try
> {
> KnowledgeBase kbase=readBase();
> StatefulKnowledgeSession ksession =
> kbase.newStatefulKnowledgeSession();
>
> ksession.startProcess("sayhi"); //ID of the process which is
> created in Designer
>
> // ksession.fireAllRules();
>
> ksession.dispose();
>
>
> }
> catch(Throwable t)
> {
>
> t.printStackTrace();
>
>
> }
>
> }
> private static KnowledgeBase readBase()
> {
>
> KnowledgeAgent kagent =
> KnowledgeAgentFactory.newKnowledgeAgent("AccountAgent");
>
> Resource changeset =
> ResourceFactory.newClassPathResource("com/simple/ProcessChangeSet.xml");
>
>
> kagent.applyChangeSet(changeset);
>
> KnowledgeBase kbase = kagent.getKnowledgeBase();
>
> return kbase;
>
>
> }
>
> }
>
>
>
> Please guide me in proper way.
> Thanks in advance.
>
>
>
>
> Thanks and regards,
> Manohar Kokkula
> Sub Focus Area Product Expert - BPM/BRE
> CEG - Open Source Technology Group
> YantraPark,Thane(West)
> Mumbai
> Ph:- +91 8793839453
> Mailto: manohar.kokkula at tcs.com
> Website: http://www.tcs.com
> ___________________________________________
> Experience certainty: IT Services
> Business Solutions
> Outsourcing
> ____________________________________________
>
> =====-----=====-----=====
>
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
>
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
>
> and any attachments. Thank you
>
>
>
> _______________________________________________
> 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/20120109/b6e3eb2e/attachment.html
More information about the rules-users
mailing list