Search in sources :

Example 16 with BusinessProcessFormModel

use of org.kie.workbench.common.forms.jbpm.model.authoring.process.BusinessProcessFormModel in project kie-wb-common by kiegroup.

the class JBPMFormModelCreationPresenterTest method initFormModels.

protected void initFormModels() {
    List<ModelProperty> processVariables = new ArrayList<>();
    processVariables.add(new ModelPropertyImpl("name", new TypeInfoImpl(String.class.getName())));
    processVariables.add(new ModelPropertyImpl("age", new TypeInfoImpl(Integer.class.getName())));
    processVariables.add(new ModelPropertyImpl("twitter", new TypeInfoImpl(String.class.getName())));
    processVariables.add(new ModelPropertyImpl("offering", new TypeInfoImpl(Integer.class.getName())));
    processVariables.add(new ModelPropertyImpl("skills", new TypeInfoImpl(String.class.getName())));
    processVariables.add(new ModelPropertyImpl("mail", new TypeInfoImpl(String.class.getName())));
    processVariables.add(new ModelPropertyImpl("hr_score", new TypeInfoImpl(Integer.class.getName())));
    processVariables.add(new ModelPropertyImpl("tech_score", new TypeInfoImpl(Integer.class.getName())));
    processVariables.add(new ModelPropertyImpl("signed", new TypeInfoImpl(Boolean.class.getName())));
    BusinessProcessFormModel processFormModel = new BusinessProcessFormModel("hiring", "hiring", processVariables);
    TaskFormModel taskFormModel;
    List<TaskFormModel> processTasks = new ArrayList<>();
    List<ModelProperty> taskVariables = new ArrayList<>();
    taskVariables.add(new ModelPropertyImpl("name", new TypeInfoImpl(String.class.getName())));
    taskVariables.add(new ModelPropertyImpl("age", new TypeInfoImpl(Integer.class.getName())));
    taskVariables.add(new ModelPropertyImpl("mail", new TypeInfoImpl(String.class.getName())));
    taskVariables.add(new ModelPropertyImpl("hr_score", new TypeInfoImpl(String.class.getName())));
    taskFormModel = new TaskFormModel("hiring", "HRInterview", taskVariables);
    processTasks.add(taskFormModel);
    taskVariables = new ArrayList<>();
    taskVariables.add(new ModelPropertyImpl("name", new TypeInfoImpl(String.class.getName())));
    taskVariables.add(new ModelPropertyImpl("age", new TypeInfoImpl(Integer.class.getName())));
    taskVariables.add(new ModelPropertyImpl("mail", new TypeInfoImpl(String.class.getName())));
    taskVariables.add(new ModelPropertyImpl("skills", new TypeInfoImpl(String.class.getName())));
    taskVariables.add(new ModelPropertyImpl("tech_score", new TypeInfoImpl(Integer.class.getName())));
    taskVariables.add(new ModelPropertyImpl("twitter", new TypeInfoImpl(String.class.getName())));
    taskFormModel = new TaskFormModel("hiring", "TechInterview", taskVariables);
    processTasks.add(taskFormModel);
    JBPMProcessModel model = new JBPMProcessModel(processFormModel, processTasks);
    formModels.add(model);
}
Also used : JBPMProcessModel(org.kie.workbench.common.forms.jbpm.model.authoring.JBPMProcessModel) ArrayList(java.util.ArrayList) BusinessProcessFormModel(org.kie.workbench.common.forms.jbpm.model.authoring.process.BusinessProcessFormModel) ModelPropertyImpl(org.kie.workbench.common.forms.model.impl.ModelPropertyImpl) TaskFormModel(org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel) ModelProperty(org.kie.workbench.common.forms.model.ModelProperty) TypeInfoImpl(org.kie.workbench.common.forms.model.impl.TypeInfoImpl)

Aggregations

BusinessProcessFormModel (org.kie.workbench.common.forms.jbpm.model.authoring.process.BusinessProcessFormModel)16 TaskFormModel (org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel)9 ArrayList (java.util.ArrayList)6 Definitions (org.eclipse.bpmn2.Definitions)5 Test (org.junit.Test)5 ModelProperty (org.kie.workbench.common.forms.model.ModelProperty)4 ModelPropertyImpl (org.kie.workbench.common.forms.model.impl.ModelPropertyImpl)4 TypeInfoImpl (org.kie.workbench.common.forms.model.impl.TypeInfoImpl)4 Path (org.uberfire.backend.vfs.Path)4 HashMap (java.util.HashMap)3 List (java.util.List)3 Process (org.eclipse.bpmn2.Process)3 FormGenerationResult (org.kie.workbench.common.forms.jbpm.server.service.formGeneration.FormGenerationResult)3 IOException (java.io.IOException)2 Optional (java.util.Optional)2 Dependent (javax.enterprise.context.Dependent)2 Inject (javax.inject.Inject)2 JBPMProcessModel (org.kie.workbench.common.forms.jbpm.model.authoring.JBPMProcessModel)2 BPMNFormModelGenerator (org.kie.workbench.common.forms.jbpm.server.service.BPMNFormModelGenerator)2 KieModuleService (org.kie.workbench.common.services.shared.project.KieModuleService)2