[rules-users] Drools Persistence Prob : No values going into 'VaraibleInstanceInfo' Table

Bill Tarr javatestcase at yahoo.com
Thu Oct 29 12:48:41 EDT 2009


Hi Pardeep,

I have gotten this functionality to work.

I am using SQL Server, but that is just a difference in the persistence.xml or datasource.  

You are seeing SessionInfo data, so your persistence is there, did you add this?

     <class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class>

Here is the main points of my code.

    EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
    env = KnowledgeBaseFactory.newEnvironment();
    env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
    VariablePersistenceStrategyFactory.getVariablePersistenceStrategy()
            .setPersister("javax.persistence.Entity",
                    "org.drools.persistence.processinstance.persisters.JPAVariablePersister");

    session = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env);
    KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(session, "log/claimsdemo");
    trackingProcessEventListener = new TrackingProcessEventListener();
    session.addEventListener(trackingProcessEventListener);

    Map<String, Object> parameterMap =
            new HashMap<String, Object>();
    parameterMap.put("claim", claim);
    processInstance = session.startProcess(CLAIM_FLOW, parameterMap);


Bill




________________________________
From: "Pardeep.Ruhil at lntinfotech.com" <Pardeep.Ruhil at lntinfotech.com>
To: rules-users at lists.jboss.org
Sent: Thu, October 29, 2009 5:56:18 AM
Subject: [rules-users] Drools Persistence Prob : No values going into 'VaraibleInstanceInfo' Table


Hi, 

I am working on persisting Drools session info into the database. 
For that I have taken a sample project from 
http://blog.athico.com/2009/09/drools-flow-variable-persistence.html.
When I tried to debug the project, no values are inserted into the table 'VaraibleInstanceInfo' table. 
However In between the debugging I am able to see data going into the table 'SessionInfo' , 'ProcessInstaceInfo', WorkItemInfo' table. But no data is going into the 'VaraibleInstanceInfo' and 'ProcessInstanceEventInfo' table. 

I have taken the code for VariableInstanceInfo.java, SerializablePersistedVariable.java,  JPAPersistedVariable.java  and other required classes for running the project from  http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-persistence-jpa/src/main/java/org/drools/persistence/processinstance/ 

Kindly tell me what going wrong in this. I am using Mysql database for persistence storage. 
 

Thanks & Regards

Pardeep Ruhil
L&T Infotech Ltd
Mumbai
Ph: +919820283884

Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com

This Document is classified as: 

L&T Infotech Proprietary   L&T Infotech Confidential   L&T Infotech Internal Use Only   L&T Infotech General Business   

This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system. 
______________________________________________________________________



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091029/7f2ef454/attachment.html 


More information about the rules-users mailing list