Hi,

Wondering if anyone can give me some help with custom workflows and tasks.

Basically I have a workflow setup via that I'm able to move a document from state to state. As part of this I have a 'Handler' that adds a task to certain user dashboard(s). However, I can't find out how to remove the tasks - any help in how to do this?

I'm adding the tasks programatically via a "node-enter" event and have tried to sort out their removal on both transition actions and "node-leave"s, both with no success (I initiate task completion by wapi.endWorkItem(itemId, Constants.WF_NEEDS_CLARIFICATION) and include a dashboardActions.invalidateDashboardItems().

An example snippet of my jpdl:

<task-node name="submitted" create-tasks="false" end-tasks="false" signal="first-wait">
     <event type="node-enter">
       <action class="com.xxx.workflow.SubmittedHandler"/>
   </event>
   <task name="Assessment" description="Document requires assessment"/>
   <transition name="for-review" to="under-review"/>
   <transition name="needs-clarification" to="awaiting-clarification"/>
   <event type="node-leave">
       <action class="com.xxx.workflow.SubmittedCleanupHandler"/>
   </event>
 </task-node>

And I'm creating the tasks in the SubmittedHandler as follows:

       Token token = executionContext.getToken();
       TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();

       TaskNode taskNode = (TaskNode) executionContext.getNode();

       Map tasks = taskNode.getTasksMap();

       Object[] managers = (Object[]) executionContext.getVariable(
               RequirementsConstants.WF_MANAGERS_LIST);

       if (managers != null) {
           for (Object manager : managers) {
               for (Object k : tasks.keySet()) {
                   TaskInstance ti = tmi.createTaskInstance(
                           taskNode.getTask((String) k), token);
                   ti.start();
                   log.debug("Requirement: Creating and starting task ="
                           + ti.getId() + " for assignee : " + manager);
                   ti.setActorId((String)manager);
               }
           }
       }

Any idea on how to remove the tasks from the user dashboards?

Thanks,

Sean

--
Dr. Sean Radford, MBBS, MSc
http://www.tacola.com/

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to