Fire workflow events for DecisionQueue reassign and decide actions.
diff --git a/jspwiki-event/src/main/java/org/apache/wiki/event/WorkflowEvent.java b/jspwiki-event/src/main/java/org/apache/wiki/event/WorkflowEvent.java
index 6f40978..76caffa 100644
--- a/jspwiki-event/src/main/java/org/apache/wiki/event/WorkflowEvent.java
+++ b/jspwiki-event/src/main/java/org/apache/wiki/event/WorkflowEvent.java
@@ -63,6 +63,12 @@
/** When the workflow wishes to remove a Decision from the DecisionQueue */
public static final int DQ_REMOVAL = 70;
+ /** When the workflow wishes to remove a Decision from the DecisionQueue */
+ public static final int DQ_DECIDE = 80;
+
+ /** When the workflow wishes to remove a Decision from the DecisionQueue */
+ public static final int DQ_REASSIGN = 90;
+
/**
* Constructs a new instance of this event type, which signals a security event has occurred.
* The <code>source</code> parameter is required, and may not be <code>null</code>. When the
diff --git a/jspwiki-main/src/main/java/org/apache/wiki/workflow/DecisionQueue.java b/jspwiki-main/src/main/java/org/apache/wiki/workflow/DecisionQueue.java
index 37d8925..679d714 100644
--- a/jspwiki-main/src/main/java/org/apache/wiki/workflow/DecisionQueue.java
+++ b/jspwiki-main/src/main/java/org/apache/wiki/workflow/DecisionQueue.java
@@ -20,6 +20,8 @@
import org.apache.wiki.api.core.Session;
import org.apache.wiki.api.exceptions.WikiException;
+import org.apache.wiki.event.WikiEventEmitter;
+import org.apache.wiki.event.WorkflowEvent;
import java.io.Serializable;
import java.security.Principal;
@@ -119,7 +121,7 @@
remove( decision );
}
- // TODO: We should fire an event indicating the Outcome, and whether the Decision completed successfully
+ WikiEventEmitter.fireWorkflowEvent( decision, WorkflowEvent.DQ_DECIDE );
}
/**
@@ -133,7 +135,7 @@
if( decision.isReassignable() ) {
decision.reassign( owner );
- // TODO: We should fire an event indicating the reassignment
+ WikiEventEmitter.fireWorkflowEvent( decision, WorkflowEvent.DQ_REASSIGN );
return;
}
throw new IllegalStateException( "Reassignments not allowed for this decision." );