[jBPM] - Java code accessing task variables
by npereira
npereira [http://community.jboss.org/people/npereira] created the discussion
"Java code accessing task variables"
To view the discussion, visit: http://community.jboss.org/message/603248#603248
--------------------------------------------------------------
Hi forum,
I'm having some trouble accessing the variables in my BPMN.
The problem is the following, I have a Human task, that has some "on entry actions".
In these on entry actions I generate a variable, named myVariable, that is local to the task.
Now my problem is when I'm on my Java code, accessing through TaskSummary:
TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1", new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
if(client.connect("127.0.0.1", 9123))
{
BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
client.getTasksAssignedAsPotentialOwner("krisv", "en-UK", taskSummaryResponseHandler);
List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
Iterator itr = tasks.iterator();
while(itr.hasNext())
{
TaskSummary t = (TaskSummary)itr.next();
System.out.println(t.getId());
...
}
How can I access these variables?
Is it possible and how?
Regards,
Nelson
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/603248#603248]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 7 months
[jBPM] - Re: jboss as 5 jbpm 5.1 persistence
by Marie MM
Marie MM [http://community.jboss.org/people/mariemm] created the discussion
"Re: jboss as 5 jbpm 5.1 persistence"
To view the discussion, visit: http://community.jboss.org/message/603425#603425
--------------------------------------------------------------
Thanks for reply. That is what I thought.
What do you mean 'BMT only'?
I am trying to run jBPM on jBoss server and I am getting following exception always when I commit something related to task (in this case TaskServiceSession.addTask()) inside of JTA transaction (new process starts in this transaction):
2011-05-04 14:32:19,234 ERROR org.hibernate.transaction.JDBCTransaction org.hibernate.transaction.JDBCTransaction (http-127.0.0.1-8080-3) JDBC commit failed
java.sql.SQLException: You cannot commit during a managed transaction!
at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:659)
at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:486)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:716)
at org.jbpm.task.service.TaskServiceSession.addTask(TaskServiceSession.java:134)
at com.piag.hcm2.wfe.impl.jbpm.GeneralTaskHandler.executeWorkItem(GeneralTaskHandler.java:165)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:53)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:101)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:122)
...
try {
UserTransaction ut = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
ut.begin();
processInstance = (WorkflowProcessInstance) ksession.startProcess(processId, params);
ut.commit();
} catch (Throwable t) {
t.printStackTrace();
}
Didn't you by any chance get similar problem?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/603425#603425]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 7 months