Package org.activiti.engine.impl.form

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


 
  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

    }
    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

    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

   
    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

 
  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

    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

      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

   
    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

TOP

Related Classes of org.activiti.engine.impl.form.TaskFormHandler

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.