[seam-commits] Seam SVN: r10654 - in modules/trunk: bpm/src/main/java/org/jboss/seam/bpm and 2 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Apr 27 08:52:32 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-04-27 08:52:32 -0400 (Mon, 27 Apr 2009)
New Revision: 10654

Added:
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/BeginTask.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/CreateProcess.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/EndTask.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/ResumeProcess.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/StartTask.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/Transition.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/package-info.java
Modified:
   modules/trunk/bpm/pom.xml
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcess.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Jbpm.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTask.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstance.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstance.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java
   modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Transition.java
   modules/trunk/version-matrix/pom.xml
Log:
add bpm annotations, more component conversion

Modified: modules/trunk/bpm/pom.xml
===================================================================
--- modules/trunk/bpm/pom.xml	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/pom.xml	2009-04-27 12:52:32 UTC (rev 10654)
@@ -35,6 +35,18 @@
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate</artifactId>
       </dependency>
+      <dependency>
+         <groupId>javax.el</groupId>
+         <artifactId>el-api</artifactId>
+      </dependency> 
+      <dependency>
+         <groupId>org.jboss.seam</groupId>
+         <artifactId>seam-el</artifactId>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.seam</groupId>
+         <artifactId>seam-international</artifactId>
+      </dependency>
    </dependencies>
 
 </project>

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcess.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcess.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcess.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -162,7 +162,8 @@
     */
    public void startTask()
    {
-      String actorId = Actor.instance().getId();
+      Actor actor = manager.getInstanceByType(Actor.class);      
+      String actorId = actor.getId();      
       TaskInstance task = org.jboss.seam.bpm.TaskInstance.instance();
       if ( actorId != null )
       {

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -8,16 +8,16 @@
 
 import java.lang.reflect.Method;
 
-import org.jboss.seam.annotations.bpm.BeginTask;
-import org.jboss.seam.annotations.bpm.CreateProcess;
-import org.jboss.seam.annotations.bpm.EndTask;
-import org.jboss.seam.annotations.bpm.ResumeProcess;
-import org.jboss.seam.annotations.bpm.StartTask;
+import org.jboss.seam.bpm.annotations.BeginTask;
+import org.jboss.seam.bpm.annotations.CreateProcess;
+import org.jboss.seam.bpm.annotations.EndTask;
+import org.jboss.seam.bpm.annotations.ResumeProcess;
+import org.jboss.seam.bpm.annotations.StartTask;
 import org.jboss.seam.annotations.intercept.AroundInvoke;
 import org.jboss.seam.annotations.intercept.Interceptor;
 import org.jboss.seam.contexts.Contexts;
 import org.jboss.seam.core.BijectionInterceptor;
-import org.jboss.seam.core.Expressions;
+import org.jboss.seam.el.Expressions;
 import org.jboss.seam.core.Init;
 import org.jboss.seam.intercept.AbstractInterceptor;
 import org.jboss.seam.intercept.InvocationContext;

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Jbpm.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Jbpm.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Jbpm.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -342,6 +342,7 @@
    }
 
    private static final DbSubProcessResolver DB_SUB_PROCESS_RESOLVER = new DbSubProcessResolver();
+   
    class SeamSubProcessResolver implements SubProcessResolver
    {
       public ProcessDefinition findSubProcess(Element element)

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -8,8 +8,10 @@
 
 import javax.annotation.PreDestroy;
 import javax.context.RequestScoped;
+import javax.inject.Current;
 import javax.inject.Initializer;
 import javax.inject.Produces;
+import javax.inject.manager.Manager;
 import javax.naming.NamingException;
 import javax.transaction.RollbackException;
 import javax.transaction.Synchronization;
@@ -38,11 +40,13 @@
 
    private JbpmContext jbpmContext;
    private boolean synchronizationRegistered;
+   
+   @Current Jbpm jbpm;
 
    @Initializer
    public void create() throws NamingException, RollbackException, SystemException
    {
-      jbpmContext = Jbpm.instance().getJbpmConfiguration().createJbpmContext();
+      jbpmContext = jbpm.getJbpmConfiguration().createJbpmContext();
       assertNoTransactionManagement();
       log.debug( "created seam managed jBPM context");
    }
@@ -145,14 +149,5 @@
       jbpmContext.close();
       log.debug( "done destroying seam managed jBPM context" );
    }
-      
-   public static JbpmContext instance()
-   {
-      if ( !Contexts.isEventContextActive() )
-      {
-         throw new IllegalStateException("no active event context");
-      }
-      return (JbpmContext) Component.getInstance(ManagedJbpmContext.class, ScopeType.EVENT);
-   }
 
 }

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTask.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTask.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTask.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -1,13 +1,9 @@
 package org.jboss.seam.bpm;
 
-import static org.jboss.seam.annotations.Install.BUILT_IN;
+import javax.context.ApplicationScoped;
+import javax.inject.Current;
+import javax.inject.manager.Manager;
 
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.web.Parameters;
 import org.jbpm.taskmgmt.exe.TaskInstance;
 
 /**
@@ -16,12 +12,10 @@
  * @see TaskInstanceList
  * @author Gavin King
  */
- at Name("org.jboss.seam.bpm.pooledTask")
- at Scope(ScopeType.APPLICATION)
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
+ at ApplicationScoped
 public class PooledTask
 {
-   
+   @Current Manager manager;
    /**
     * Assign the TaskInstance with the id passed
     * in the request parameter named "taskId" to
@@ -33,7 +27,7 @@
    @Transactional
    public String assignToCurrentActor()
    {
-      Actor actor = Actor.instance();
+      Actor actor = manager.getInstanceByType(Actor.class);
       if ( actor.getId()==null )
       {
          throw new IllegalStateException("no current actor id defined");

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -1,16 +1,12 @@
 package org.jboss.seam.bpm;
 
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
 import java.util.ArrayList;
 import java.util.List;
 
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.annotations.Unwrap;
+import javax.inject.Current;
+import javax.inject.Produces;
+import javax.inject.manager.Manager;
+
 import org.jbpm.taskmgmt.exe.TaskInstance;
 
 /**
@@ -19,17 +15,14 @@
  * @see TaskInstanceList
  * @author Gavin King
  */
- at Name("org.jboss.seam.bpm.pooledTaskInstanceList")
- at Scope(ScopeType.APPLICATION)
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
 public class PooledTaskInstanceList
 {
+   @Current Manager manager;
    
-   @Unwrap
-   @Transactional
+   @Produces @Transactional
    public List<TaskInstance> getPooledTaskInstanceList()
    {
-      Actor actor = Actor.instance();
+      Actor actor = manager.getInstanceByType(Actor.class);
       String actorId = actor.getId();
       if ( actorId == null ) return null;
       ArrayList groupIds = new ArrayList( actor.getGroupActorIds() );

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstance.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstance.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstance.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -6,16 +6,9 @@
  */
 package org.jboss.seam.bpm;
 
-import static org.jboss.seam.annotations.Install.BUILT_IN;
+import javax.annotation.Named;
+import javax.inject.Produces;
 
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
 import org.jboss.seam.util.Work;
 
 /**
@@ -24,14 +17,9 @@
  * 
  * @author Gavin King
  */
- at Scope(ScopeType.STATELESS)
- at Name("org.jboss.seam.bpm.processInstance")
- at BypassInterceptors
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
 public class ProcessInstance 
-{
-   
-   @Unwrap
+{   
+   @Produces @Named
    public org.jbpm.graph.exe.ProcessInstance getProcessInstance() throws Exception
    {
       if ( !Contexts.isConversationContextActive() ) return null;
@@ -57,11 +45,4 @@
       }.workInTransaction();
       
    }
-   
-   public static org.jbpm.graph.exe.ProcessInstance instance()
-   {
-      if ( !Contexts.isConversationContextActive() || !BusinessProcess.instance().hasCurrentProcess() ) return null; //so we don't start a txn
-      
-      return (org.jbpm.graph.exe.ProcessInstance) Component.getInstance(ProcessInstance.class, ScopeType.STATELESS);
-   }
 }

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -4,15 +4,14 @@
 import static org.hibernate.criterion.Order.desc;
 import static org.hibernate.criterion.Restrictions.isNotNull;
 import static org.hibernate.criterion.Restrictions.isNull;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
 
 import java.util.List;
 
+import javax.annotation.Named;
+import javax.inject.Produces;
+
 import org.hibernate.Criteria;
 import org.hibernate.criterion.Restrictions;
-import org.jboss.seam.annotations.Factory;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Transactional;
 import org.jbpm.graph.exe.ProcessInstance;
 
@@ -21,8 +20,6 @@
  * 
  * @author Gavin King
  */
- at Name("org.jboss.seam.bpm.processInstanceFinder")
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
 public class ProcessInstanceFinder
 {
    
@@ -31,8 +28,7 @@
    private Boolean processInstanceEnded = false;
    private Boolean sortDescending = false;
    
-   @Factory(value="org.jboss.seam.bpm.processInstanceList", autoCreate=true)
-   @Transactional
+   @Produces @Named @Transactional
    public List<ProcessInstance> getProcessInstanceList()
    {
       Criteria query = ManagedJbpmContext.instance().getSession()

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -14,8 +14,8 @@
 
 import org.jboss.seam.el.EL;
 import org.jboss.seam.el.SeamFunctionMapper;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
 import org.jbpm.jpdl.el.ELException;
 import org.jbpm.jpdl.el.Expression;
 import org.jbpm.jpdl.el.ExpressionEvaluator;

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstance.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstance.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstance.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -43,11 +43,4 @@
       }.workInTransaction();
    }
    
-   public static org.jbpm.taskmgmt.exe.TaskInstance instance()
-   {
-      if ( !Contexts.isConversationContextActive() || !BusinessProcess.instance().hasCurrentTask() ) return null; //so we don't start a txn
-      
-      return (org.jbpm.taskmgmt.exe.TaskInstance) Component.getInstance(TaskInstance.class, ScopeType.STATELESS);
-   }
-   
 }

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -2,7 +2,6 @@
 
 import java.util.List;
 
-import javax.context.ApplicationScoped;
 import javax.inject.Produces;
 
 import org.jbpm.taskmgmt.exe.TaskInstance;

Modified: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Transition.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Transition.java	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/Transition.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -1,16 +1,9 @@
 package org.jboss.seam.bpm;
 
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
 import java.io.Serializable;
 
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
+import javax.context.ConversationScoped;
+
 import org.jboss.seam.core.AbstractMutable;
 
 /**
@@ -21,10 +14,7 @@
  * 
  * @author Gavin King
  */
- at Name("org.jboss.seam.bpm.transition")
- at Scope(ScopeType.CONVERSATION)
- at BypassInterceptors
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
+ at ConversationScoped
 public class Transition extends AbstractMutable implements Serializable 
 {
    private static final long serialVersionUID = -3054558654376670239L;
@@ -45,15 +35,6 @@
       this.name = name;
    }
    
-   public static Transition instance()
-   {
-      if ( !Contexts.isApplicationContextActive() )
-      {
-         throw new IllegalStateException("No active application context");
-      }
-      return (Transition) Component.getInstance(Transition.class, ScopeType.CONVERSATION);
-   }
-   
    @Override
    public String toString()
    {

Added: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/BeginTask.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/BeginTask.java	                        (rev 0)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/BeginTask.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.annotations.bpm;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.jboss.seam.annotations.FlushModeType;
+
+/**
+ * Marks a method as causing a jBPM {@link org.jbpm.taskmgmt.exe.TaskInstance task}
+ * to be resumed. The jBPM {@link org.jbpm.context.exe.ContextInstance} 
+ * is associated with the BUSINESS_PROCESS scope and the 
+ * {@link org.jbpm.taskmgmt.exe.TaskInstance} is associated with a new
+ * conversation, unless the annotated method returns a null outcome.
+ * <p/>
+ * Note that both {@link BeginTask} and {@link StartTask} have effect
+ * before invocation of the intercepted method in that they are both
+ * about setting up appropriate {@link org.jbpm.context.exe.ContextInstance}
+ * for the current {@link org.jboss.seam.contexts.BusinessProcessContext}.
+ * <p/>
+ *
+ * @author Steve Ebersole
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+ at Documented
+public @interface BeginTask
+{
+   /**
+    * The name of the request parameter under which we should locate the
+    * the id of task to be resumed.
+    */
+   String taskIdParameter() default "";
+   /**
+    * An EL expression that evaluates to the task id.
+    * @return an EL expression
+    */
+   String taskId() default "#{param.taskId}";
+   /**
+    * The name of the jBPM process definition defining the page flow for 
+    * this conversation.
+    */
+   String pageflow() default "";
+   /**
+    * An EL expression for the conversation id. If a conversation with 
+    * the same id aready exists, Seam will redirect to that conversation.
+    * 
+    * @deprecated use <conversation/> in pages.xml
+    */
+   String id() default "";
+   /**
+    * Set the FlushMode for any EntityManager used in
+    * this conversation.
+    */
+   FlushModeType flushMode() default FlushModeType.AUTO;
+}

Added: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/CreateProcess.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/CreateProcess.java	                        (rev 0)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/CreateProcess.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.annotations.bpm;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a method creating a jBPM 
+ * {@link org.jbpm.graph.exe.ProcessInstance process instance}
+ * unless the method throws an exception or returns a null outcome.
+ * 
+ * @author Steve Ebersole
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+ at Documented
+public @interface CreateProcess
+{
+   /**
+    * The name of the {@link org.jbpm.graph.def.ProcessDefinition} from which
+    * to create the {@link org.jbpm.graph.exe.ProcessInstance}
+    */
+   String definition();
+   /**
+    * An EL expression that evaluates to the process 
+    * business key.
+    * 
+    * @return an EL expression or an empty string to indicate a null key
+    */
+   String processKey() default "";
+}

Added: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/EndTask.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/EndTask.java	                        (rev 0)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/EndTask.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.annotations.bpm;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a method as causing a jBPM 
+ * {@link org.jbpm.taskmgmt.exe.TaskInstance task instance}
+ * to be ended. The current conversation also ends. If a list of outcomes 
+ * is specified, the task ends only if the outcome is in the list. A null
+ * outcome never ends the task.
+ *
+ * @see org.jbpm.taskmgmt.exe.TaskInstance#end(String)
+ * @author Gavin King
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+ at Documented
+public @interface EndTask 
+{
+   
+   /**
+    * An empty outcome list is interpreted to mean any 
+    * outcome except for the null (redisplay) outcome.
+    * 
+    * @deprecated use BusinessProcess.instance().end("...") and
+    *             Conversation.instance().end()
+    */
+   String[] ifOutcome() default {};
+   
+   /**
+    * Specifies the transition that should be triggered by
+    * completing the task. If the transition needs to be
+    * specified dynamically, use the Seam <tt>transition</tt>
+    * component, calling <tt>Transition.setName()<tt>.
+    * 
+    * @return a transition name
+    */
+   String transition() default "";
+   
+   /**
+    * Should the conversation be destroyed before any
+    * redirect? (The default behavior is to propagate
+    * the conversation across the redirect and then
+    * destroy it at the end of the redirected request.)
+    * 
+    * @return false by default
+    */
+   boolean beforeRedirect() default false;
+  
+}

Added: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/ResumeProcess.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/ResumeProcess.java	                        (rev 0)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/ResumeProcess.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.annotations.bpm;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a method as causing an existing jBPM 
+ * {@link org.jbpm.graph.exe.ProcessInstance process instance}
+ * to be associated with the current conversation, unless the 
+ * annotated method returns a null outcome.
+ * 
+ * @author Steve Ebersole
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+ at Documented
+public @interface ResumeProcess
+{
+   /**
+    * The name of the request parameter under which we should locate the
+    * the id of process to be resumed.
+    * (not required for lookup by business key)
+    * 
+    * @return a request parameter name
+    */
+   String processIdParameter() default "";
+   /**
+    * An EL expression that evaluates to the process id.
+    * (not required for lookup by business key)
+    * 
+    * @return an EL expression
+    */
+   String processId() default "#{param.processId}";
+   /**
+    * An EL expression that evaluates to the process 
+    * business key.
+    * (optional, only required for lookup by business key)
+    * 
+    * @return an EL expression
+    */
+   String processKey() default "";
+   /**
+    * The name of the {@link org.jbpm.graph.def.ProcessDefinition}
+    * (optional, only required for lookup by business key)
+    */
+   String definition() default "";
+}

Added: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/StartTask.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/StartTask.java	                        (rev 0)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/StartTask.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.annotations.bpm;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.jboss.seam.annotations.FlushModeType;
+
+/**
+ * Marks a method as causing jBPM {@link org.jbpm.taskmgmt.exe.TaskInstance task}
+ * to be started. The jBPM {@link org.jbpm.context.exe.ContextInstance} 
+ * is associated with the BUSINESS_PROCESS scope and the 
+ * {@link org.jbpm.taskmgmt.exe.TaskInstance} is associated with a new
+ * conversation, unless the annotated method returns a null outcome.
+ * <p/>
+ * Note that both {@link BeginTask} and {@link StartTask} have effect
+ * before invocation of the intercepted method in that they are both
+ * about setting up appropriate {@link org.jbpm.context.exe.ContextInstance}
+ * for the current {@link org.jboss.seam.contexts.BusinessProcessContext};
+ * {@link StartTask} however, also has effect after method invocation
+ * as that is the time it actually marks the task as started.
+ *
+ * @see org.jbpm.taskmgmt.exe.TaskInstance#start()
+ * @author Steve Ebersole
+ */
+ at Target( METHOD )
+ at Retention( RUNTIME )
+ at Documented
+public @interface StartTask
+{
+   /**
+    * The name of the request parameter under which we should locate the
+    * the id of task to be started.
+    */
+   String taskIdParameter() default "";
+   /**
+    * An EL expression that evaluates to the task id.
+    * @return an EL expression
+    */
+   String taskId() default "#{param.taskId}";
+   /**
+    * The name of the jBPM process definition defining 
+    * the page flow for this conversation.
+    */
+   String pageflow() default "";
+   /**
+    * An EL expression for the conversation id. If a conversation with 
+    * the same id aready exists, Seam will redirect to that conversation.
+    * 
+    * @deprecated use <conversation/> in pages.xml
+    */
+   String id() default "";
+   /**
+    * Set the FlushMode for any EntityManager used in
+    * this conversation.
+    */
+   FlushModeType flushMode() default FlushModeType.AUTO;
+}

Added: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/Transition.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/Transition.java	                        (rev 0)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/Transition.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.annotations.bpm;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Marks a method as causing a jBPM transition after 
+ * the method returns a non-null result without exception.
+ * 
+ * @author Gavin King
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+ at Documented
+public @interface Transition 
+{
+   
+   /**
+    * The transition name, defaults to the name
+    * of the method.
+    * 
+    * @return the transition name
+    */
+   String value() default "";
+   
+}

Added: modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/package-info.java
===================================================================
--- modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/package-info.java	                        (rev 0)
+++ modules/trunk/bpm/src/main/java/org/jboss/seam/bpm/annotations/package-info.java	2009-04-27 12:52:32 UTC (rev 10654)
@@ -0,0 +1,9 @@
+/**
+ * Annotations for controlling the business process
+ * and business process context.
+ *
+ * @see org.jboss.seam.bpm
+ * @see org.jboss.seam.bpm.BusinessProcess
+ */
+package org.jboss.seam.annotations.bpm;
+

Modified: modules/trunk/version-matrix/pom.xml
===================================================================
--- modules/trunk/version-matrix/pom.xml	2009-04-27 12:51:10 UTC (rev 10653)
+++ modules/trunk/version-matrix/pom.xml	2009-04-27 12:52:32 UTC (rev 10654)
@@ -207,6 +207,12 @@
             <version>${seam.version}</version>                     
          </dependency>
          
+         <dependency>
+            <groupId>org.jboss.seam</groupId>
+            <artifactId>seam-international</artifactId>
+            <version>${seam.version}</version>                     
+         </dependency>
+         
       </dependencies>
    </dependencyManagement>
 




More information about the seam-commits mailing list