Search in sources :

Example 1 with FormType

use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.

the class MockProvider method createMockTaskFormDataUsingFormFieldsWithoutFormKey.

public static TaskFormData createMockTaskFormDataUsingFormFieldsWithoutFormKey() {
    FormField mockFormField = mock(FormField.class);
    when(mockFormField.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
    when(mockFormField.getLabel()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
    when(mockFormField.getDefaultValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
    FormType mockFormType = mock(FormType.class);
    when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
    when(mockFormField.getType()).thenReturn(mockFormType);
    TaskFormData mockFormData = mock(TaskFormData.class);
    when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
    List<FormField> mockFormFields = new ArrayList<FormField>();
    mockFormFields.add(mockFormField);
    when(mockFormData.getFormFields()).thenReturn(mockFormFields);
    return mockFormData;
}
Also used : FormType(org.camunda.bpm.engine.form.FormType) ArrayList(java.util.ArrayList) TaskFormData(org.camunda.bpm.engine.form.TaskFormData) HistoricFormField(org.camunda.bpm.engine.history.HistoricFormField) FormField(org.camunda.bpm.engine.form.FormField)

Example 2 with FormType

use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.

the class MockProvider method createMockStartFormDataUsingFormFieldsWithoutFormKey.

public static StartFormData createMockStartFormDataUsingFormFieldsWithoutFormKey(ProcessDefinition definition) {
    FormField mockFormField = mock(FormField.class);
    when(mockFormField.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
    when(mockFormField.getLabel()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
    when(mockFormField.getDefaultValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
    FormType mockFormType = mock(FormType.class);
    when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
    when(mockFormField.getType()).thenReturn(mockFormType);
    StartFormData mockFormData = mock(StartFormData.class);
    when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
    when(mockFormData.getProcessDefinition()).thenReturn(definition);
    List<FormField> mockFormFields = new ArrayList<FormField>();
    mockFormFields.add(mockFormField);
    when(mockFormData.getFormFields()).thenReturn(mockFormFields);
    return mockFormData;
}
Also used : StartFormData(org.camunda.bpm.engine.form.StartFormData) FormType(org.camunda.bpm.engine.form.FormType) ArrayList(java.util.ArrayList) HistoricFormField(org.camunda.bpm.engine.history.HistoricFormField) FormField(org.camunda.bpm.engine.form.FormField)

Example 3 with FormType

use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.

the class MockProvider method createMockTaskFormData.

public static TaskFormData createMockTaskFormData() {
    FormProperty mockFormProperty = mock(FormProperty.class);
    when(mockFormProperty.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
    when(mockFormProperty.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
    when(mockFormProperty.getValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
    when(mockFormProperty.isReadable()).thenReturn(EXAMPLE_FORM_PROPERTY_READABLE);
    when(mockFormProperty.isWritable()).thenReturn(EXAMPLE_FORM_PROPERTY_WRITABLE);
    when(mockFormProperty.isRequired()).thenReturn(EXAMPLE_FORM_PROPERTY_REQUIRED);
    FormType mockFormType = mock(FormType.class);
    when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
    when(mockFormProperty.getType()).thenReturn(mockFormType);
    TaskFormData mockFormData = mock(TaskFormData.class);
    when(mockFormData.getFormKey()).thenReturn(EXAMPLE_FORM_KEY);
    when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
    List<FormProperty> mockFormProperties = new ArrayList<FormProperty>();
    mockFormProperties.add(mockFormProperty);
    when(mockFormData.getFormProperties()).thenReturn(mockFormProperties);
    return mockFormData;
}
Also used : FormProperty(org.camunda.bpm.engine.form.FormProperty) FormType(org.camunda.bpm.engine.form.FormType) ArrayList(java.util.ArrayList) TaskFormData(org.camunda.bpm.engine.form.TaskFormData)

Example 4 with FormType

use of org.camunda.bpm.engine.form.FormType in project camunda-bpm-platform by camunda.

the class MockProvider method createMockStartFormData.

// form data
public static StartFormData createMockStartFormData(ProcessDefinition definition) {
    FormProperty mockFormProperty = mock(FormProperty.class);
    when(mockFormProperty.getId()).thenReturn(EXAMPLE_FORM_PROPERTY_ID);
    when(mockFormProperty.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_NAME);
    when(mockFormProperty.getValue()).thenReturn(EXAMPLE_FORM_PROPERTY_VALUE);
    when(mockFormProperty.isReadable()).thenReturn(EXAMPLE_FORM_PROPERTY_READABLE);
    when(mockFormProperty.isWritable()).thenReturn(EXAMPLE_FORM_PROPERTY_WRITABLE);
    when(mockFormProperty.isRequired()).thenReturn(EXAMPLE_FORM_PROPERTY_REQUIRED);
    FormType mockFormType = mock(FormType.class);
    when(mockFormType.getName()).thenReturn(EXAMPLE_FORM_PROPERTY_TYPE_NAME);
    when(mockFormProperty.getType()).thenReturn(mockFormType);
    StartFormData mockFormData = mock(StartFormData.class);
    when(mockFormData.getFormKey()).thenReturn(EXAMPLE_FORM_KEY);
    when(mockFormData.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID);
    when(mockFormData.getProcessDefinition()).thenReturn(definition);
    List<FormProperty> mockFormProperties = new ArrayList<FormProperty>();
    mockFormProperties.add(mockFormProperty);
    when(mockFormData.getFormProperties()).thenReturn(mockFormProperties);
    return mockFormData;
}
Also used : FormProperty(org.camunda.bpm.engine.form.FormProperty) StartFormData(org.camunda.bpm.engine.form.StartFormData) FormType(org.camunda.bpm.engine.form.FormType) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)4 FormType (org.camunda.bpm.engine.form.FormType)4 FormField (org.camunda.bpm.engine.form.FormField)2 FormProperty (org.camunda.bpm.engine.form.FormProperty)2 StartFormData (org.camunda.bpm.engine.form.StartFormData)2 TaskFormData (org.camunda.bpm.engine.form.TaskFormData)2 HistoricFormField (org.camunda.bpm.engine.history.HistoricFormField)2