Package org.jbpm.taskmgmt.exe

Examples of org.jbpm.taskmgmt.exe.TaskInstance


    protected void cancelTasks(List tasks) {
  log.info("cancel " + tasks.size() + " tasks");
  if (tasks != null && tasks.size() > 0) {
      for (Iterator it = tasks.iterator(); it.hasNext();) {
    TaskInstance ti = (TaskInstance) it.next();

    // if the process def doesn't set signal="never", we have to
    // manually turn off signaling for all tasks;
    // otherwise, the token will be triggered instead of being
    // ended.
    // Do this until http://jira.jboss.com/jira/browse/JBPM-392 is
    // resolved

    log.info("cancel task " + ti);
    ti.setSignalling(false);
    ti.cancel();
      }
  }
    }
View Full Code Here


  public CancelWorkOnTaskCommand() {   
  }
 
  public Object execute(JbpmContext jbpmContext) throws Exception
    TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId);
    ti.setActorId(null);
    ti.setStart(null);
    return null;
  }
View Full Code Here

      SourceBean request = requestContainer.getServiceRequest();
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        jbpmContext = jbpmConfiguration.createJbpmContext();
        String activityKeyIdStr = (String) request.getAttribute("ActivityKey");
      long activityKeyId = Long.valueOf(activityKeyIdStr).longValue();
      TaskInstance taskInstance = jbpmContext.getTaskInstance(activityKeyId);
      if(taskInstance.getStart()==null) {
        taskInstance.start();
      }
      String publisherName = taskInstance.getVariable("spago_handler").toString();
      return publisherName;
    } finally {
        if (jbpmContext != null) {
          jbpmContext.close();
        }
View Full Code Here

    try{
      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        jbpmContext = jbpmConfiguration.createJbpmContext();
        String activityKeyIdStr = (String) request.getAttribute("ActivityKey");
      long activityKeyId = Long.valueOf(activityKeyIdStr).longValue();
      TaskInstance taskInstance = jbpmContext.getTaskInstance(activityKeyId);
      ContextInstance contextInstance = taskInstance.getContextInstance();
        ProcessInstance processInstance = contextInstance.getProcessInstance();
     
        if (request.getAttribute("CompletedActivity") != null){
          // Submit buttin named CompleteActivity is pressed
          SpagoBITracer.info("Workflow", "CompleteOrRejectActivityModule", "service", "Completing Activity ["+ activityKeyId + "]");
          taskInstance.end();
        } else {
          //  Submit buttin named RejectActivity is pressed
          SpagoBITracer.info("Workflow", "CompleteOrRejectActivityModule", "service", "Completing Activity ["+ activityKeyId + "]");
          taskInstance.cancel();
        }
        jbpmContext.save(processInstance);
    } catch (Exception e) {
      SpagoBITracer.major(SpagoBIConstants.NAME_MODULE, this.getClass().getName(),
                      "service", "Error during the complete or reject workflow activity", e);
View Full Code Here

      while (rolesIt.hasNext()) {
        String role = (String) rolesIt.next();
        List tmpTaskList = jbpmContext.getTaskList(role);
        Iterator iterTaskInst = tmpTaskList.iterator();
        while(iterTaskInst.hasNext()) {
          TaskInstance ti = (TaskInstance)iterTaskInst.next();
          taskList.add(ti);
        }
      }
      SourceBean workListAsSourceBean = tasksToSourceBean(taskList);
      return workListAsSourceBean;
View Full Code Here

         Long workflowProcessId = null;
         try {
           JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
                     jbpmContext = jbpmConfiguration.createJbpmContext();
           long activityKeyId = Long.valueOf(activityKey).longValue();
           TaskInstance taskInstance = jbpmContext.getTaskInstance(activityKeyId);
           ContextInstance contextInstance = taskInstance.getContextInstance();
           ProcessInstance processInstance = contextInstance.getProcessInstance();
           workflowProcessId = new Long(processInstance.getId());
           String dossierIdStr = (String) contextInstance.getVariable(DossierConstants.DOSSIER_ID);
           dossierId = new Integer(dossierIdStr);
         } finally {
View Full Code Here

      // recover task instance and variables
      String activityKey = (String) request.getAttribute(SpagoBIConstants.ACTIVITYKEY);
      String approved = (String) request.getAttribute("approved");
      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
      jbpmContext = jbpmConfiguration.createJbpmContext();
      TaskInstance taskInstance = jbpmContext.getTaskInstance(new Long(activityKey).longValue());
      contextInstance = taskInstance.getContextInstance();
      ProcessInstance processInstance = contextInstance.getProcessInstance();
      Long workflowProcessId = new Long(processInstance.getId());
      String dossierIdStr = (String) contextInstance.getVariable(DossierConstants.DOSSIER_ID);
      Integer dossierId = new Integer(dossierIdStr);
      // store presentation
View Full Code Here

    try {
      // recover task instance and variables
      String activityKey = (String)request.getAttribute("activityKey");
      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
      jbpmContext = jbpmConfiguration.createJbpmContext();
      TaskInstance taskInstance = jbpmContext.getTaskInstance(new Long(activityKey).longValue());
      String index = (String)taskInstance.getVariable(DossierConstants.DOSSIER_PART_INDEX);
      int pageNum = Integer.parseInt(index);
      ContextInstance contextInstance = taskInstance.getContextInstance();
      ProcessInstance processInstance = contextInstance.getProcessInstance();
      Long workflowProcessId = new Long(processInstance.getId());
      String dossierIdStr = (String)contextInstance.getVariable(DossierConstants.DOSSIER_ID);
      Integer dossierId = new Integer(dossierIdStr);
     
View Full Code Here

      Integer dossierId = new Integer(dossierIdStr);
      String noteSent = (String)request.getAttribute("notes");
      String activityKey = (String)request.getAttribute(SpagoBIConstants.ACTIVITYKEY);
      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
      jbpmContext = jbpmConfiguration.createJbpmContext();
      TaskInstance taskInstance = jbpmContext.getTaskInstance(new Long(activityKey).longValue());
      ContextInstance contextInstance = taskInstance.getContextInstance();
      ProcessInstance processInstance = contextInstance.getProcessInstance();
      Long workflowProcessId = new Long(processInstance.getId());
      SessionContainer session = this.getRequestContainer().getSessionContainer();
      SessionContainer permanentSession = session.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile) permanentSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
View Full Code Here

    * @see Actor
    */
   public void startTask()
   {
      String actorId = Actor.instance().getId();
      TaskInstance task = org.jboss.seam.bpm.TaskInstance.instance();
      if ( actorId != null )
      {
         task.start(actorId);
      }
      else
      {
         task.start();
      }
     
      Events.instance().raiseEvent("org.jboss.seam.startTask." + task.getTask().getName());
   }
View Full Code Here

TOP

Related Classes of org.jbpm.taskmgmt.exe.TaskInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.