Package org.activiti.engine.form

Examples of org.activiti.engine.form.TaskFormData


    centralLayout.addComponent(relatedContent);
  }
 
  protected void initTaskForm() {
    // Check if task requires a form
    TaskFormData formData = formService.getTaskFormData(task.getId());
    if(formData != null && formData.getFormProperties() != null && formData.getFormProperties().size() > 0) {
      taskForm = new FormPropertiesForm();
      taskForm.setSubmitButtonCaption(i18nManager.getMessage(Messages.TASK_COMPLETE));
      taskForm.setCancelButtonCaption(i18nManager.getMessage(Messages.TASK_RESET_FORM));
      taskForm.setFormHelp(i18nManager.getMessage(Messages.TASK_FORM_HELP));
      taskForm.setFormProperties(formData.getFormProperties());
     
      taskForm.addListener(new FormPropertiesEventListener() {
       
        private static final long serialVersionUID = -3893467157397686736L;
View Full Code Here


    // 获取第一个节点
    TaskService taskService = activitiRule.getTaskService();
    Task task = taskService.createTaskQuery().singleResult();
    assertEquals("First Step", task.getName());
   
    TaskFormData taskFormData = formService.getTaskFormData(task.getId());
    assertNotNull(taskFormData);
    assertNull(taskFormData.getFormKey());
    List<FormProperty> taskFormProperties = taskFormData.getFormProperties();
    assertNotNull(taskFormProperties);
    for (FormProperty formProperty : taskFormProperties) {
      System.out.println(ToStringBuilder.reflectionToString(formProperty));
    }
    formProperties = new HashMap<String, String>();
    formProperties.put("setInFirstStep", "01/12/2012");
    formService.submitTaskFormData(task.getId(), formProperties);
   
    // 获取第二个节点
    task = taskService.createTaskQuery().taskName("Second Step").singleResult();
    assertNotNull(task);
    taskFormData = formService.getTaskFormData(task.getId());
    assertNotNull(taskFormData);
    List<FormProperty> formProperties2 = taskFormData.getFormProperties();
    assertNotNull(formProperties2);
    assertEquals(1, formProperties2.size());
    assertNotNull(formProperties2.get(0).getValue());
    assertEquals(formProperties2.get(0).getValue(), "01/12/2012");
   
View Full Code Here

  @Deployment
  public void testDefaultValue() throws Exception {
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("FormPropertyDefaultValueTest.testDefaultValue");
    Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult();

    TaskFormData formData = formService.getTaskFormData(task.getId());
    List<FormProperty> formProperties = formData.getFormProperties();
    assertEquals(4, formProperties.size());

    for (FormProperty prop : formProperties) {
      if ("booleanProperty".equals(prop.getId())) {
        assertEquals("true", prop.getValue());
View Full Code Here

    Map<String, Object> variables = runtimeService.getVariables(processInstanceId);
    assertEquals(expectedVariables, variables);

    Task task = taskService.createTaskQuery().singleResult();
    String taskId = task.getId();
    TaskFormData taskForm = formService.getTaskFormData(taskId);
    assertEquals(deploymentId, taskForm.getDeploymentId());
    assertEquals("org/activiti/engine/test/api/form/task.form", taskForm.getFormKey());
    assertEquals(new ArrayList<FormProperty>(), taskForm.getFormProperties());
    assertEquals(taskId, taskForm.getTask().getId());

    assertEquals("Mike is speaking in room 5b", formService.getRenderedTaskForm(taskId));

    properties = new HashMap<String, String>();
    properties.put("room", "3f");
View Full Code Here

    Address address = new Address();
    address.setStreet("broadway");
    runtimeService.setVariable(processInstanceId, "address", address);

    String taskId = taskService.createTaskQuery().singleResult().getId();
    TaskFormData taskFormData = formService.getTaskFormData(taskId);

    List<FormProperty> formProperties = taskFormData.getFormProperties();
    FormProperty propertyRoom = formProperties.get(0);
    assertEquals("room", propertyRoom.getId());
    assertEquals("5b", propertyRoom.getValue());

    FormProperty propertyDuration = formProperties.get(1);
View Full Code Here

  @Override
  protected List processList(List list) {
    List<TaskResponse> responseList = new ArrayList<TaskResponse>();
    for (Object task : list) {
      TaskResponse taskResponse = new TaskResponse((Task) task);
      TaskFormData taskFormData = ActivitiUtil.getFormService().getTaskFormData(taskResponse.getId());
      if(taskFormData != null) {
        taskResponse.setFormResourceKey(taskFormData.getFormKey());    
      }
      responseList.add(taskResponse);
    }
    return responseList;
  }
View Full Code Here

   
    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.form.TaskFormData

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.