[jboss-user] [jBPM] - Re: How to reload knowledgeSession from database?
roxy1987 [https://community.jboss.org/people/roxy1987] created the discussion Re: How to reload knowledgeSession from database? To view the discussion, visit: https://community.jboss.org/message/799400#799400 -- To use JMS human task service, you need to modify the human task war. In web.xml, you can change the value of the parameter from hornetQ or mina to jms. -- Reply to this message by going to Community [https://community.jboss.org/message/799400#799400] Start a new discussion in jBPM at Community [https://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034] ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [jBPM] - Re: How to reload knowledgeSession from database?
sc_boss [https://community.jboss.org/people/sc_boss] created the discussion Re: How to reload knowledgeSession from database? To view the discussion, visit: https://community.jboss.org/message/799114#799114 -- i'm running into the same issue. Any luck? -- Reply to this message by going to Community [https://community.jboss.org/message/799114#799114] Start a new discussion in jBPM at Community [https://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034] ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [jBPM] - Re: How to reload knowledgeSession from database?
wei wei [http://community.jboss.org/people/wwweeii] created the discussion Re: How to reload knowledgeSession from database? To view the discussion, visit: http://community.jboss.org/message/614305#614305 -- I can use JPAKnowledgeService.loadStatefulKnowledgeSession(taskid,kbase,null ,env) method reload a stateful session from database.But when i use taskclient complete the human task,the stateful session can not know the human task have been completed.I don't know how to continue the process.I want krisv or salaboy come to answer my question! thanks! -- Reply to this message by going to Community [http://community.jboss.org/message/614305#614305] Start a new discussion in jBPM at Community [http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034] ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [jBPM] - Re: How to reload knowledgeSession from database?
wei wei [http://community.jboss.org/people/wwweeii] created the discussion Re: How to reload knowledgeSession from database? To view the discussion, visit: http://community.jboss.org/message/613736#613736 -- Thanks Cristiano I want to know how to use a jms based human task service? -- Reply to this message by going to Community [http://community.jboss.org/message/613736#613736] Start a new discussion in jBPM at Community [http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034] ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [jBPM] - Re: How to reload knowledgeSession from database?
Cristiano Nicolai [http://community.jboss.org/people/cristiano.nicolai] created the discussion Re: How to reload knowledgeSession from database? To view the discussion, visit: http://community.jboss.org/message/613607#613607 -- Hi wei, Please have a look at: http://docs.jboss.org/jbpm/v5.1/userguide/ch07.html#d0e2745 http://docs.jboss.org/jbpm/v5.1/userguide/ch07.html#d0e2745 It explains how to create and load a jpa based session. -- Reply to this message by going to Community [http://community.jboss.org/message/613607#613607] Start a new discussion in jBPM at Community [http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034] ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [jBPM] - Re: How to reload knowledgeSession from database?
wei wei [http://community.jboss.org/people/wwweeii] created the discussion Re: How to reload knowledgeSession from database? To view the discussion, visit: http://community.jboss.org/message/613608#613608 -- Thank you! I have tried this method, #but after the intercepted human task was completed, the Ksession couldn’t know it, the state of the task was still 1, and I couldn’t continue with the other tasks. How can I solve this problem? Here are codes: package com.sample; import java.util.HashMap; import java.util.Map; import java.util.Properties; import javax.naming.InitialContext; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.transaction.UserTransaction; import org.drools.KnowledgeBaseFactory; import org.drools.base.MapGlobalResolver; import org.drools.runtime.*; import org.drools.persistence.jpa.*; import org.jbpm.process.audit.JPAWorkingMemoryDbLogger; import org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler; import bitronix.tm.TransactionManagerServices; import bitronix.tm.resource.jdbc.PoolingDataSource; public class TestLoadSession { public void loadSession(){ EntityManagerFactory emf = Persistence.createEntityManagerFactory( org.jbpm.persistence.jpa ); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager()); env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() ); StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( 1, KBaseFactory.getKbase(), null, env ); } public static final void main(String[] args) { try{ UserTransaction ut = (UserTransaction) new InitialContext().lookup( java:comp/UserTransaction ); PoolingDataSource ds1 = new PoolingDataSource(); ds1 = new PoolingDataSource(); ds1.setUniqueName( jdbc/testDS1 ); ds1.setClassName( com.mysql.jdbc.jdbc2.optional.MysqlXADataSource ); ds1.setMaxPoolSize( 3 ); ds1.setAllowLocalTransactions( true ); ds1.getDriverProperties().put( user,root ); ds1.getDriverProperties().put( password,11 ); ds1.getDriverProperties().put( URL, jdbc:mysql://localhost:3306/jbpm5db ); ds1.init(); ut.begin(); EntityManagerFactory emf = Persistence.createEntityManagerFactory( org.jbpm.persistence.jpa ); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf); env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager()); env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() ); //Properties properties = new Properties(); //properties.put(drools.processInstanceManagerFactory, org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory); //properties.put(drools.processSignalManagerFactory, org.jbpm.persistence.processinstance.JPASignalManagerFactory); //KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties); StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( 1, KBaseFactory.getKbase(), null, env ); ksession.getWorkItemManager().registerWorkItemHandler(Human Task, new CommandBasedWSHumanTaskHandler(ksession)); JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession); //ksession.notifyAll(); //ksession.abortProcessInstance(1); //ksession.startProcessInstance(1); //ksession.getProcessInstance(1). ut.commit(); logger.dispose(); ut.begin(); Map data2=new HashMap(); Map data3=new HashMap(); data3.put(name, This is my test Human Task param 22!!); data3.put(second, The Second is KYO!!); data2.put(name1,data3); System.out.println(This is before commit:+data2); JbpmAPIUtil.completeTask(1, data2, krisv); ut.commit(); System.out.println(LOADSSESSION success!); } catch(Exception e){ e.printStackTrace(); } } } -- Reply to this message by going to Community [http://community.jboss.org/message/613608#613608] Start a new discussion in jBPM at Community [http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034] ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [jBPM] - Re: How to reload knowledgeSession from database?
Cristiano Nicolai [http://community.jboss.org/people/cristiano.nicolai] created the discussion Re: How to reload knowledgeSession from database? To view the discussion, visit: http://community.jboss.org/message/613609#613609 -- The key point for the session to know about when a task is completed is the CommandBasedWSHumanTaskHandler in this case. If you're using the Mina based human task service your session must be up and your handler connected to be notified that a task was completed. There is a jms based human task service and handler that can help you to keep this service independent from the session. -- Reply to this message by going to Community [http://community.jboss.org/message/613609#613609] Start a new discussion in jBPM at Community [http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2034] ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user