hi,
i am using the following code to close the task instance while writing the 
custom client for the BPM system.
the code iam using is :
jbpmContext = jbpmConfiguration.createJbpmContext();
                        Connection conn=jbpmContext.getConnection();
                        //conn.setAutoCommit(true);
                        Transaction transaction = 
jbpmContext.getSession().beginTransaction();
                        GraphSession graphSession = 
jbpmContext.getGraphSession();
                        ProcessDefinition processDefinition = 
graphSession.loadProcessDefinition(processDefinitionId);
                        System.out.println("the process definition is 
"+processDefinition);
                        //ProcessInstance processInstance = 
processDefinition.createProcessInstance();
                        ProcessInstance processInstance = 
jbpmContext.newProcessInstance(processDefinition.getName());
                        System.out.println("the process instance is 
"+processInstance+"id is "+processInstance.getId());
                        
                        //processInstance.signal();
                        
                        //ProcessInstance processInstance 
=jbpmContext.newProcessInstance(processDefinition.getName());//new 
ProcessInstance(processDefinition);
                        //processInstance = 
jbpmContext.loadProcessInstanceForUpdate(processInstance.getId());
                        TaskInstance taskInstance = 
processInstance.getTaskMgmtInstance().createStartTaskInstance();
                        System.out.println("the task instance is 
"+taskInstance);
                        
                        System.out.println("the task instance is 
"+taskInstance.getName());
                        //this.initialize(taskInstance,taskFormParams);
                        taskInstance.start();
                        System.out.println(taskInstance.getId());
                        //taskInstance.end();
                        System.out.println("this is the date and tiem of 
creation fo the task instance"+taskInstance.getStart());
                        try{
                                taskInstance.end();
                        }
                        catch(Exception e)
                        {
                                System.out.println("this is the excetion comes 
at the end of the task instance"+e.fillInStackTrace());                  
                        }
                        jbpmContext.save(taskInstance);
                        //jbpmContext.save(processInstance);
                        //jbpmContext.getSession().flush();
                        //jbpmContext.getSession().clear();
                        transaction.commit();
                        //processInstance.end();
                        //conn.setAutoCommit(false);
                        jbpmContext.close();


tehn iam getting the following exception :
it is eating all my time and resources.please help me to get out of thsi 
situation.


StatefulPersi W org.hibernate.engine.StatefulPersistenceContext  Narrowing 
proxy to class org.jbpm.graph.node.TaskNode - this operation breaks ==
[6/2/06 12:11:16:047 IST] 711d6ced DbPersistence E 
org.jbpm.persistence.db.DbPersistenceService  problem rolling back after failed 
commit
[6/2/06 12:11:16:047 IST] 711d6ced DbPersistence E 
org.jbpm.persistence.db.DbPersistenceService  TRAS0014I: The following 
exception was logged org.hibernate.TransactionException: Transaction not 
successfully started
        at 
org.hibernate.transaction.JTATransaction.rollback(JTATransaction.java:171)
        at 
org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:165)
        at org.jbpm.svc.Services.close(Services.java:211)
        at org.jbpm.JbpmContext.close(JbpmContext.java:138)
        at 
com.yash.jbpm.client.Configuration.startProcessInstance(Configuration.java:195)
        at com.yash.jbpm.client.ProcessStarter.doPost(ProcessStarter.java:47)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
        at 
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
        at 
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
        at 
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
        at 
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
        at 
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
        at 
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
        at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:983)
        at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:564)
        at 
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:200)
        at 
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:119)
        at 
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:276)
        at 
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
        at 
com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:116)
        at 
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
        at 
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
        at 
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
        at 
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:618)
        at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:672


"ANY HELP REGARDING THIS WILL BE APPRICIATED"
Regards,
mohan chokkakula.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3948607#3948607

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3948607


_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to