[jboss-user] [JBoss jBPM] - tasks lost in flight when exception occurs

gnagy do-not-reply at jboss.com
Fri Aug 1 06:14:10 EDT 2008


In the process of getting rid of the seemingly deprecated gravel and j4j dependency, we moved task transitions to seam component action methods, like this:


	public String transit(TaskInstance taskInstance, String transitionName) {
		
		JbpmContext context = ManagedJbpmContext.instance();
		// without this, LazyInitializationException occurs
		taskInstance = context.getTaskInstanceForUpdate(taskInstance.getId());
		taskInstance.end(transitionName);

		return "success";
	}


Before we used:

	<h:commandLink>
		<4j:loadTask id="#{taskInstance.id}" target="#{j4jtask}"/>
		<j4j:completeTask task="#{j4jtask}" transition="#{transition.name}"/>
		<h:outputText value="#{transition.name}"/>
	</h:commandLink>


We have some event actions on tasks (calling methods on seam components), and when an exception occurs there, the task is lost from our task list.

The task list is rendered as follows:
<ui:repeat var="taskInstance" value="#{taskInstanceList}">...

Looking at the db, the exceptional transition cleared the isopen and issignaling flag in the jbmp_taskinstance table.

I'm pretty sure this worked with the j4j action handlers, but it's really hard to revert now. How can we keep the task in "open" state, even if an exception occurs?

Thanks,
Greg

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

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



More information about the jboss-user mailing list