Search in sources :

Example 1 with GenericServiceTaskPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter in project kie-wb-common by kiegroup.

the class TaskConverter method genericServiceTask.

private PropertyWriter genericServiceTask(Node<View<GenericServiceTask>, ?> n) {
    org.eclipse.bpmn2.ServiceTask task = bpmn2.createServiceTask();
    task.setId(n.getUUID());
    GenericServiceTask definition = n.getContent().getDefinition();
    GenericServiceTaskPropertyWriter p = propertyWriterFactory.of(task);
    TaskGeneralSet general = definition.getGeneral();
    GenericServiceTaskExecutionSet executionSet = definition.getExecutionSet();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAbsoluteBounds(n);
    p.setSimulationSet(definition.getSimulationSet());
    p.setValue(executionSet.getGenericServiceTaskInfo().getValue());
    p.setAsync(executionSet.getIsAsync().getValue());
    p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
    if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) {
        p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential());
        p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue());
        p.setInput(executionSet.getMultipleInstanceDataInput().getValue());
        p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue());
        p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue());
        p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue());
    }
    p.setOnEntryAction(executionSet.getOnEntryAction());
    p.setOnExitAction(executionSet.getOnExitAction());
    p.setSLADueDate(executionSet.getSlaDueDate().getValue());
    p.setAssignmentsInfo(executionSet.getAssignmentsinfo());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    return p;
}
Also used : GenericServiceTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter) GenericServiceTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet) GenericServiceTask(org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) Factories.bpmn2(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2)

Example 2 with GenericServiceTaskPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter in project kie-wb-common by kiegroup.

the class GenericServiceTaskPropertyReaderTest method setUp.

@Before
public void setUp() {
    ServiceTask serviceTask = bpmn2.createServiceTask();
    value = new GenericServiceTaskValue("java", "serviceInterface", "serviceOperation", "inMessageStructure", "outMessageStructure");
    GenericServiceTaskPropertyWriter writer = new GenericServiceTaskPropertyWriter(serviceTask, null, new HashSet<>());
    writer.setValue(value);
    writer.setSLADueDate(SLA_DUE_DATE);
    writer.setAsync(false);
    writer.setAdHocAutostart(true);
    OnEntryAction onEntryAction = new OnEntryAction();
    onEntryAction.setValue(new ScriptTypeListValue());
    writer.setOnEntryAction(onEntryAction);
    OnExitAction onExitAction = new OnExitAction();
    onExitAction.setValue(new ScriptTypeListValue());
    writer.setOnExitAction(onExitAction);
    writer.setAssignmentsInfo(new AssignmentsInfo());
    reader = new GenericServiceTaskPropertyReader(serviceTask, diagram, definitionResolver);
}
Also used : GenericServiceTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter) ServiceTask(org.eclipse.bpmn2.ServiceTask) GenericServiceTaskValue(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue) Before(org.junit.Before)

Aggregations

GenericServiceTaskPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter)2 ServiceTask (org.eclipse.bpmn2.ServiceTask)1 Before (org.junit.Before)1 Factories.bpmn2 (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2)1 GenericServiceTask (org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask)1 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)1 TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)1 GenericServiceTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet)1 GenericServiceTaskValue (org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskValue)1 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)1 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)1 ScriptTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue)1