This is an automated email from the ASF dual-hosted git repository. juanpablo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 0675bd015ba005dd2fdc7bb777b15eca5d0630f1 Author: juanpablo <[email protected]> AuthorDate: Sun May 3 21:54:46 2020 +0200 Fire workflow events for DecisionQueue reassign and decide actions. --- .../src/main/java/org/apache/wiki/event/WorkflowEvent.java | 6 ++++++ .../src/main/java/org/apache/wiki/workflow/DecisionQueue.java | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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 @@ public final class WorkflowEvent extends WikiEvent { /** 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 @@ package org.apache.wiki.workflow; 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 @@ public class DecisionQueue implements Serializable { 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 @@ public class DecisionQueue implements Serializable { 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." );
