[jboss-cvs] jboss-seam/src/main/org/jboss/seam/jbpm ...
Gavin King
gavin.king at jboss.com
Mon Jun 18 13:27:23 EDT 2007
User: gavin
Date: 07/06/18 13:27:23
Modified: src/main/org/jboss/seam/jbpm SeamUserCodeInterceptor.java
Log:
JBSEAM-1112
fix a problem with interception of pageflow actions
Revision Changes Path
1.3 +29 -7 jboss-seam/src/main/org/jboss/seam/jbpm/SeamUserCodeInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SeamUserCodeInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/jbpm/SeamUserCodeInterceptor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- SeamUserCodeInterceptor.java 16 Jun 2007 01:43:42 -0000 1.2
+++ SeamUserCodeInterceptor.java 18 Jun 2007 17:27:23 -0000 1.3
@@ -3,6 +3,7 @@
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.core.BusinessProcess;
+import org.jboss.seam.core.Jbpm;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.Action;
import org.jbpm.graph.exe.ExecutionContext;
@@ -13,6 +14,14 @@
import org.jbpm.taskmgmt.exe.Assignable;
import org.jbpm.taskmgmt.exe.TaskInstance;
+/**
+ * Intercepts calls to user code coming from jBPM, sets up
+ * Seam contexts and associates the process and task instances
+ * with the contexts.
+ *
+ * @author Gavin King
+ *
+ */
public class SeamUserCodeInterceptor implements UserCodeInterceptor
{
abstract static class ContextualCall
@@ -58,6 +67,12 @@
public void executeAction(final Action action, final ExecutionContext context) throws Exception
{
+ if ( isPageflow(context) )
+ {
+ action.execute(context);
+ }
+ else
+ {
new ContextualCall()
{
@Override
@@ -68,6 +83,13 @@
}
}.run();
}
+ }
+
+ private boolean isPageflow(final ExecutionContext context)
+ {
+ return Contexts.isConversationContextActive() &&
+ Jbpm.instance().isPageflowProcessDefinition( context.getProcessDefinition().getName() );
+ }
public void executeAssignment(final AssignmentHandler handler, final Assignable assignable,
final ExecutionContext context)
More information about the jboss-cvs-commits
mailing list