AnsweredAssumed Answered

Task generated without Resource

Question asked by sanket on May 24, 2010
Latest reply on May 24, 2010 by sanket
Hi Guise. I have created a rule "Add My Workflow to Item" to a space. So any Item arriving in the space will trigger my workflow. The task is
generated on the approver's dashboard with approve-reject button. That's fine. Just the problem is- When the approver opens his dashboard, he can see his task but not getting the "Resource" (file) on which the workflow is started.
I want to add the resource. Can u plz tell where am I going wrong ?

protected void executeImpl(Action arg0, NodeRef arg1) {
      WorkflowDefinition wd = null;
      NodeRef personNodeId =  getPersonService().getPerson("sanket");
      List a = getWorkflowService().getAllDefinitions();
      Iterator i = a.iterator();
      while (i.hasNext()) {
          wd = (WorkflowDefinition);
         System.out.println("workflow name—–>" +;

         if ("jbpm$wf:review")) {
      // Create a workflow node reference
      NodeRef workflowNodeRef = workflowService.createPackage(arg1);
      // Finally kick the workflow off.
      Map<QName, Serializable> parameters = new HashMap<QName, Serializable>();
      parameters.put(WorkflowModel.ASSOC_PACKAGE, workflowNodeRef);
      /*this.nodeService.addChild(workflowNodeRef, arg1,
                ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
                      arg1, ContentModel.PROP_NAME))));*/
      NodeRef workflowPackage = (NodeRef)arg0.getParameterValue(WorkflowModel.ASSOC_PACKAGE.toPrefixString(namespaceService));
        workflowPackage = workflowService.createPackage(workflowPackage);
        ChildAssociationRef childAssoc = nodeService.getPrimaryParent(arg1);
        nodeService.addChild(workflowPackage, arg1, ContentModel.ASSOC_CONTAINS, childAssoc.getQName());

      parameters.put(WorkflowModel.PROP_WORKFLOW_DUE_DATE, new Date(System.currentTimeMillis()));
      parameters.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, "Sanket,you are assigned a task");
      parameters.put(WorkflowModel.ASSOC_ASSIGNEE, personNodeId);
      WorkflowPath path = workflowService.startWorkflow(, parameters);
      System.out.println("initiated successfully");