-
1. Re: How Continue Process Execution Using Java (Without the j
sreepathia Jun 9, 2008 12:06 PM (in response to fornachari)If you have two task nodes after the first signal your first start taskinstance would start automatically.Now to got o next tasskinstance I.e Admin task,
You get the taskinstances of user,do your custom code and then signal/end the user taskinstance to got to admin taskistance. then you get the admin task instance and signal it to to go to end.
For more help Refer examples for more detail.
Thanks -
2. Re: How Continue Process Execution Using Java (Without the j
fornachari Jun 9, 2008 3:06 PM (in response to fornachari)Hi sreepathis, thank you very much for your reply.
I am trying what you said, and I find some information in the internet.
I am doing like below, but without success:JbpmContext ctx = JbpmConfiguration.getInstance().createJbpmContext(); GraphSession graphSession = ctx.getGraphSession(); //8 is the id of my process instance ProcessInstance processInstance = graphSession.loadProcessInstance(8); Collection taskList = null; taskList = (Collection) processInstance.getTaskMgmtInstance().getTaskInstances(); taskList.iterator().next(); ((TaskInstance)taskList.iterator().next()).end(); //set the admin's comment, like I said in my first post processInstance.getContextInstance().setVariable("adminComment", "Approved");
could you help me?
Thank you! -
3. Re: How Continue Process Execution Using Java (Without the j
sreepathia Jun 9, 2008 4:09 PM (in response to fornachari)If you are not getting any error then you are doing right and you should have completed task 1 with the code you posted.now you repeat the same process for the task2
and the process instance will be completed then.Collection taskList = null; taskList = (Collection) processInstance.getTaskMgmtInstance().getTaskInstances(); taskList.iterator().next(); ((TaskInstance)taskList.iterator().next()).end();
Try your luck and see.
Thanks -
4. Re: How Continue Process Execution Using Java (Without the j
fornachari Jun 9, 2008 4:44 PM (in response to fornachari)Sorry, sorry..
I am working so hard here that I forget the error. When I execute the code of my last post, I receive this error:org.hibernate.exception.JDBCConnectionException: could not load an entity: [org.jbpm.graph.exe.Token#8] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.loadEntity(Loader.java:1874) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3042) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:98) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:836) at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150) at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$f23ef6ca.hashCode(<generated>) at java.util.HashMap.put(Unknown Source) at org.hibernate.collection.PersistentMap.readFrom(PersistentMap.java:259) at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1008) at org.hibernate.loader.Loader.readCollectionElements(Loader.java:646) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:591) at org.hibernate.loader.Loader.doQuery(Loader.java:701) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.loadCollection(Loader.java:1994) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.AbstractPersistentCollection.readIndexExistence(AbstractPersistentCollection.java:125) at org.hibernate.collection.PersistentMap.containsKey(PersistentMap.java:128) at org.jbpm.context.exe.ContextInstance.getTokenVariableMap(ContextInstance.java:363) at org.jbpm.context.exe.ContextInstance.getVariable(ContextInstance.java:166) at org.jbpm.context.exe.ContextInstance.getVariable(ContextInstance.java:156) at ContinuarExecucao.main(ContinuarExecucao.java:74) Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.getImplConnection(Unknown Source) at com.microsoft.jdbc.base.BaseStatement.setupImplConnection(Unknown Source) at com.microsoft.jdbc.base.BaseStatement.<init>(Unknown Source) at com.microsoft.jdbc.base.BasePreparedStatement.<init>(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547) at org.hibernate.loader.Loader.doQuery(Loader.java:673) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.loadEntity(Loader.java:1860) ... 33 more ----------------------------> ERROR: could not load an entity: [org.jbpm.graph.exe.Token#8]
Any help would be appreciate!
Thank you again! -
5. Re: How Continue Process Execution Using Java (Without the j
kukeltje Jun 9, 2008 6:18 PM (in response to fornachari)look at the many, many testcases on how to use the jbpm API. For your last question, you probably have to search the hibernate forum and then get back here....