Examples of TaskFormHandler


Examples of org.activiti.engine.impl.form.TaskFormHandler

    if (task == null) {
      throw new ActivitiException("No task found for taskId '" + taskId +"'");
    }
   
    if(task.getTaskDefinition() != null) {
      TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
      if (taskFormHandler == null) {
        throw new ActivitiException("No taskFormHandler specified for task '" + taskId +"'");
      }
     
      return taskFormHandler.createTaskForm(task);
    } else {
      // Standalone task, no TaskFormData available
      return null;
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

 
  protected Object execute(CommandContext commandContext, TaskEntity task) {
    commandContext.getHistoryManager()
      .reportFormPropertiesSubmitted(task.getExecution(), properties, taskId);
   
    TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
    taskFormHandler.submitFormProperties(properties, task.getExecution());
   
    task.complete();

    return null;
  }
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

    }
    return activity;
  }

  public TaskDefinition parseTaskDefinition(Element taskElement, String taskDefinitionKey, ProcessDefinitionEntity processDefinition) {
    TaskFormHandler taskFormHandler;
    String taskFormHandlerClassName = taskElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "formHandlerClass");
    if (taskFormHandlerClassName != null) {
      taskFormHandler = (TaskFormHandler) ReflectUtil.instantiate(taskFormHandlerClassName);
    } else {
      taskFormHandler = new DefaultTaskFormHandler();
    }
    taskFormHandler.parseConfiguration(taskElement, deployment, processDefinition, this);

    TaskDefinition taskDefinition = new TaskDefinition(taskFormHandler);

    taskDefinition.setKey(taskDefinitionKey);
    processDefinition.getTaskDefinitions().put(taskDefinitionKey, taskDefinition);
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

    activity.setProperty(PROPERTY_TASK_DEFINITION, taskDefinition);
    activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createUserTaskActivityBehavior(userTask, taskDefinition));
  }
 
  public TaskDefinition parseTaskDefinition(BpmnParse bpmnParse, UserTask userTask, String taskDefinitionKey, ProcessDefinitionEntity processDefinition) {
    TaskFormHandler taskFormHandler = new DefaultTaskFormHandler();
    taskFormHandler.parseConfiguration(userTask.getFormProperties(), userTask.getFormKey(), bpmnParse.getDeployment(), processDefinition);

    TaskDefinition taskDefinition = new TaskDefinition(taskFormHandler);

    taskDefinition.setKey(taskDefinitionKey);
    processDefinition.getTaskDefinitions().put(taskDefinitionKey, taskDefinition);
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

   
    if (task.getTaskDefinition() == null) {
      throw new ActivitiException("Task form definition for '" + taskId +"' not found");
    }
   
    TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
    if (taskFormHandler == null) {
      return null;
    }
   
    FormEngine formEngine = commandContext
      .getProcessEngineConfiguration()
      .getFormEngines()
      .get(formEngineName);
   
    if (formEngine==null) {
      throw new ActivitiException("No formEngine '" + formEngineName +"' defined process engine configuration");
    }
   
    TaskFormData taskForm = taskFormHandler.createTaskForm(task);
   
    return formEngine.renderTaskForm(taskForm);
  }
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

 
  protected Object execute(CommandContext commandContext, TaskEntity task) {
    commandContext.getHistoryManager()
      .reportFormPropertiesSubmitted(task.getExecution(), properties, taskId);
   
    TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
    taskFormHandler.submitFormProperties(properties, task.getExecution());

    if (completeTask) {
      task.complete(properties, false);
    }
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

    if (task == null) {
      throw new ActivitiObjectNotFoundException("No task found for taskId '" + taskId +"'", Task.class);
    }
   
    if(task.getTaskDefinition() != null) {
      TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
      if (taskFormHandler == null) {
        throw new ActivitiException("No taskFormHandler specified for task '" + taskId +"'");
      }
     
      return taskFormHandler.createTaskForm(task);
    } else {
      // Standalone task, no TaskFormData available
      return null;
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

      HistoricTaskInstanceEntity historicTaskInstance = getDbSqlSession().selectById(HistoricTaskInstanceEntity.class, task.getId());
      if (historicTaskInstance != null) {
        historicTaskInstance.setTaskDefinitionKey(taskDefinitionKey);
       
        if (taskDefinitionKey != null) {
          TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
          if (taskFormHandler != null) {
            if (taskFormHandler.getFormKey() != null) {
              Object formValue = taskFormHandler.getFormKey().getValue(task.getExecution());
              if (formValue != null) {
                historicTaskInstance.setFormKey(formValue.toString());
              }
            }
          }
View Full Code Here

Examples of org.activiti.engine.impl.form.TaskFormHandler

   
    if (task.getTaskDefinition() == null) {
      throw new ActivitiException("Task form definition for '" + taskId +"' not found");
    }
   
    TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
    if (taskFormHandler == null) {
      return null;
    }
   
    FormEngine formEngine = Context
      .getProcessEngineConfiguration()
      .getFormEngines()
      .get(formEngineName);
   
    if (formEngine==null) {
      throw new ActivitiException("No formEngine '" + formEngineName +"' defined process engine configuration");
    }
   
    TaskFormData taskForm = taskFormHandler.createTaskForm(task);
   
    return formEngine.renderTaskForm(taskForm);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.form.handler.TaskFormHandler

      .findTaskById(taskId);
    ensureNotNull("Task '" + taskId + "' not found", "task", task);

    ensureNotNull("Task form definition for '" + taskId + "' not found", "task.getTaskDefinition()", task.getTaskDefinition());

    TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
    if (taskFormHandler == null) {
      return null;
    }

    FormEngine formEngine = Context
      .getProcessEngineConfiguration()
      .getFormEngines()
      .get(formEngineName);

    ensureNotNull("No formEngine '" + formEngineName + "' defined process engine configuration", "formEngine", formEngine);

    TaskFormData taskForm = taskFormHandler.createTaskForm(task);

    return formEngine.renderTaskForm(taskForm);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.