Search in sources :

Example 1 with GenericServiceTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet 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 GenericServiceTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet in project kie-wb-common by kiegroup.

the class GenericServiceTaskTest method setAndGetExecutionSet.

@Test
public void setAndGetExecutionSet() {
    GenericServiceTask genericServiceTask = new GenericServiceTask(new TaskGeneralSet(new Name("Service Task"), new Documentation("")), new GenericServiceTaskExecutionSet(), new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), new SimulationSet(), new TaskType(TaskTypes.SERVICE_TASK), new AdvancedData());
    assertEquals(new GenericServiceTaskExecutionSet(), genericServiceTask.getExecutionSet());
    GenericServiceTaskExecutionSet set = new GenericServiceTaskExecutionSet();
    genericServiceTask.setExecutionSet(set);
    assertEquals(set, genericServiceTask.getExecutionSet());
}
Also used : FontSet(org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) SimulationSet(org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet) BackgroundSet(org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet) GenericServiceTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) TaskType(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskType) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) RectangleDimensionsSet(org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) Test(org.junit.Test)

Example 3 with GenericServiceTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet in project kie-wb-common by kiegroup.

the class BaseTaskConverter method bpmnServiceTask.

BpmnNode bpmnServiceTask(org.eclipse.bpmn2.ServiceTask task) {
    Node<View<GenericServiceTask>, Edge> node = factoryManager.newNode(task.getId(), GenericServiceTask.class);
    GenericServiceTask definition = node.getContent().getDefinition();
    GenericServiceTaskPropertyReader p = propertyReaderFactory.of(task);
    if (p == null) {
        throw new NullPointerException(task.getClass().getCanonicalName());
    }
    definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(p.getGenericServiceTask()), p.getAssignmentsInfo(), new AdHocAutostart(p.isAdHocAutostart()), new IsAsync(p.isAsync()), new IsMultipleInstance(p.isMultipleInstance()), new MultipleInstanceExecutionMode(p.isSequential()), new MultipleInstanceCollectionInput(p.getCollectionInput()), new MultipleInstanceDataInput(p.getDataInput()), new MultipleInstanceCollectionOutput(p.getCollectionOutput()), new MultipleInstanceDataOutput(p.getDataOutput()), new MultipleInstanceCompletionCondition(p.getCompletionCondition()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new SLADueDate(p.getSLADueDate())));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    definition.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    return BpmnNode.of(node, p);
}
Also used : GenericServiceTaskInfo(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskInfo) GenericServiceTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet) GenericServiceTask(org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) MultipleInstanceCollectionOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) OnExitAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction) AdHocAutostart(org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart) OnEntryAction(org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction) View(org.kie.workbench.common.stunner.core.graph.content.view.View) DmnModelName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) DecisionName(org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) MultipleInstanceCompletionCondition(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) MultipleInstanceCollectionInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput) MultipleInstanceExecutionMode(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceExecutionMode) MultipleInstanceDataInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput) GenericServiceTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GenericServiceTaskPropertyReader) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge) MultipleInstanceDataOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput)

Aggregations

TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)3 GenericServiceTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet)3 GenericServiceTask (org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask)2 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)2 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)2 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)2 Test (org.junit.Test)1 Factories.bpmn2 (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2)1 GenericServiceTaskPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter)1 GenericServiceTaskPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GenericServiceTaskPropertyReader)1 BackgroundSet (org.kie.workbench.common.stunner.bpmn.definition.property.background.BackgroundSet)1 RectangleDimensionsSet (org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.RectangleDimensionsSet)1 FontSet (org.kie.workbench.common.stunner.bpmn.definition.property.font.FontSet)1 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)1 GenericServiceTaskInfo (org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskInfo)1 SimulationSet (org.kie.workbench.common.stunner.bpmn.definition.property.simulation.SimulationSet)1 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)1 DecisionName (org.kie.workbench.common.stunner.bpmn.definition.property.task.DecisionName)1 DmnModelName (org.kie.workbench.common.stunner.bpmn.definition.property.task.DmnModelName)1 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)1