Package org.activiti.workflow.simple.definition.form

Examples of org.activiti.workflow.simple.definition.form.FormDefinition


  }

  protected HorizontalLayout generateActionButtons(Object taskItemId) {
    HorizontalLayout actionButtons = new HorizontalLayout();

    FormDefinition form = taskFormModel.getForm(taskItemId);
    Button formButton = new Button(form == null ? i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_FORM_CREATE) :
        i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_FORM_EDIT));
    formButton.addListener(new ShowFormClickListener(taskFormModel, taskItemId));
    formButton.setData(taskItemId);
    actionButtons.addComponent(formButton);
View Full Code Here


        humanStepDefinition.setDescription(description);
      }
     
      humanStepDefinition.setStartsWithPrevious((boolean) ((CheckBox) item.getItemProperty(ID_START_WITH_PREVIOUS).getValue()).booleanValue());
     
      FormDefinition formDefinition = taskFormModel.getForm(itemId);
      humanStepDefinition.setForm(formDefinition);

      steps.add(humanStepDefinition);
    }
    return steps;
View Full Code Here

    HumanStepDefinition stepWithForm = new HumanStepDefinition();
    stepWithForm.setName("step4");
    stepWithForm.setDescription("Step description");
   
    workflowDefinition.getSteps().add(stepWithForm);
    FormDefinition formDefinition = new FormDefinition();
    stepWithForm.setForm(formDefinition);
    formDefinition.setFormKey("123");
   
    TextPropertyDefinition textProp = new TextPropertyDefinition();
    textProp.setMandatory(true);
    textProp.setName("textProp");
    textProp.setWritable(false);
    formDefinition.addFormProperty(textProp);
    textProp.getParameters().put("custom-parameter", "This is a test");
   
    NumberPropertyDefinition numberProp = new NumberPropertyDefinition();
    numberProp.setMandatory(true);
    numberProp.setName("numberProp");
    numberProp.setWritable(false);
    formDefinition.addFormProperty(numberProp);
   
    ReferencePropertyDefinition reference = new ReferencePropertyDefinition();
    reference.setMandatory(true);
    reference.setName("referenceProp");
    reference.setWritable(false);
    reference.setType("referencedType");
    formDefinition.addFormProperty(reference);
   
    ListPropertyDefinition itemType = new ListPropertyDefinition();
    itemType.setMandatory(true);
    itemType.setName("referenceProp");
    itemType.setWritable(false);
    itemType.addEntry(new ListPropertyEntry("1", "Item 1"));
    itemType.addEntry(new ListPropertyEntry("2", "Item 2"));
    formDefinition.addFormProperty(itemType);
   
    // Write result to byte-array
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Writer writer = new OutputStreamWriter(baos);
    converter.writeWorkflowDefinition(workflowDefinition, writer);
View Full Code Here

    public void testCovertFormPropertiesWithListValues() {
        TestStepDefinitionConverter converter = new TestStepDefinitionConverter();

        // Create a form with two properties, one of which is a ListProperty

        FormDefinition formDefinition = new FormDefinition();

        ListPropertyDefinition approveEnum = new ListPropertyDefinition();
        approveEnum.setName("Approval");
        approveEnum.setType("enum");
        approveEnum.addEntry(new ListPropertyEntry("true", "Approve"));
        approveEnum.addEntry(new ListPropertyEntry("false", "Reject"));
        formDefinition.addFormProperty(approveEnum);

        TextPropertyDefinition reason = new TextPropertyDefinition();
        reason.setName("Reason");
        reason.setType("string");
        formDefinition.addFormProperty(reason);

        List<FormProperty> properties = converter.convertProperties(formDefinition);
        assertTrue(properties.size() == 2);

        FormProperty firstProperty = properties.get(0);
View Full Code Here

    }
   
    // Form
    if (humanStepDefinition.getForm() != null) {
     
      FormDefinition formDefinition = humanStepDefinition.getForm();
     
      // Form properties
      userTask.setFormProperties(convertProperties(formDefinition));
     
      if(formDefinition.getFormKey() != null) {
        userTask.setFormKey(formDefinition.getFormKey());
      }
    }

    return userTask;
  }
View Full Code Here

    saveButton.addListener(new Button.ClickListener() {

      private static final long serialVersionUID = -2906886872414089331L;

      public void buttonClick(ClickEvent event) {
        FormDefinition form = createForm();
        formModel.addForm(taskItemId, form);
        close();
      }
    });
View Full Code Here

    layout.addComponent(new Label(""));
    layout.addComponent(buttons);
  }

  public FormDefinition createForm() {
    FormDefinition formDefinition = new FormDefinition();
    for (Object itemId : propertyTable.getItemIds()) {
     
      Item item = propertyTable.getItem(itemId);
      FormPropertyDefinition formPropertyDefinition = getFormPropertyDefinition(item);
      formDefinition.addFormProperty(formPropertyDefinition);
    }
    return formDefinition;
  }
View Full Code Here

   
    return result;
  }

  protected void fillFormFields() {
    FormDefinition form = formModel.getForm(taskItemId);
    if (form == null) {
      propertyTable.addPropertyRow();
    } else {
      for (FormPropertyDefinition property : form.getFormPropertyDefinitions()) {
        propertyTable.addPropertyRow(property.getName(), getPropertyTypeDisplay(property), property.isMandatory());
      }
    }
  }
View Full Code Here

    HumanStepDefinition reviewTask = new HumanStepDefinition();
    reviewTask.setName(stepDefinition.getName());
    reviewTask.setDescription("Review task");

    // Clone the review-form and add custom transitions property
    FormDefinition finalForm = null;
    if (stepDefinition.getForm() != null) {
      finalForm = stepDefinition.getForm().clone();
    } else {
      finalForm = new FormDefinition();
    }
    finalForm.addFormProperty(createTransitionsProperty());
    reviewTask.setForm(finalForm);
   
   
    // Assignment
    if(stepDefinition.getAssignmentType() == HumanStepAssignmentType.USER) {
View Full Code Here

    WorkflowDefinition definition = new WorkflowDefinition();
    definition.setId("process");
   
    HumanStepDefinition humanStep = new HumanStepDefinition();
    humanStep.setId("step1");
    FormDefinition form = new FormDefinition();
    form.setFormKey("myform");
    humanStep.setForm(form);
   
    definition.addStep(humanStep);
   
    WorkflowDefinitionConversion conversion = conversionFactory.createWorkflowDefinitionConversion(definition);
View Full Code Here

TOP

Related Classes of org.activiti.workflow.simple.definition.form.FormDefinition

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.