Search in sources :

Example 1 with CustomTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet in project kie-wb-common by kiegroup.

the class TaskConverter method customTask.

private PropertyWriter customTask(Node<View<CustomTask>, ?> n) {
    org.eclipse.bpmn2.Task task = bpmn2.createTask();
    task.setId(n.getUUID());
    CustomTask definition = n.getContent().getDefinition();
    ServiceTaskPropertyWriter p = propertyWriterFactory.of(task);
    p.setServiceTaskName(definition.getName());
    TaskGeneralSet general = definition.getGeneral();
    p.setName(general.getName().getValue());
    p.setDocumentation(general.getDocumentation().getValue());
    p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
    CustomTaskExecutionSet executionSet = definition.getExecutionSet();
    p.setTaskName(executionSet.getTaskName().getValue());
    p.setAsync(executionSet.getIsAsync().getValue());
    p.setOnEntryAction(executionSet.getOnEntryAction());
    p.setOnExitAction(executionSet.getOnExitAction());
    p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
    p.setSlaDueDate(executionSet.getSlaDueDate().getValue());
    p.setSimulationSet(definition.getSimulationSet());
    p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
    p.setAbsoluteBounds(n);
    return p;
}
Also used : GenericServiceTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.GenericServiceTaskPropertyWriter) ServiceTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ServiceTaskPropertyWriter) CustomTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) Task(org.eclipse.bpmn2.Task) Factories.bpmn2(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2) CustomTask(org.kie.workbench.common.stunner.bpmn.workitem.CustomTask)

Example 2 with CustomTaskExecutionSet

use of org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet in project kie-wb-common by kiegroup.

the class BaseTaskConverter method jbpmServiceTask.

private BpmnNode jbpmServiceTask(org.eclipse.bpmn2.Task task) {
    final ServiceTaskPropertyReader serviceTaskPropertyReader = propertyReaderFactory.ofCustom(task);
    final Node<View<CustomTask>, Edge> node = factoryManager.newNode(task.getId(), CustomTask.class);
    final CustomTask definition = node.getContent().getDefinition();
    definition.setName(serviceTaskPropertyReader.getServiceTaskName());
    definition.getTaskType().setRawType(serviceTaskPropertyReader.getServiceTaskName());
    definition.setDescription(serviceTaskPropertyReader.getServiceTaskDescription());
    definition.setCategory(serviceTaskPropertyReader.getServiceTaskCategory());
    definition.setDefaultHandler(serviceTaskPropertyReader.getServiceTaskDefaultHandler());
    definition.setGeneral(new TaskGeneralSet(new Name(serviceTaskPropertyReader.getName()), new Documentation(serviceTaskPropertyReader.getDocumentation())));
    definition.setDataIOSet(new DataIOSet(serviceTaskPropertyReader.getAssignmentsInfo()));
    definition.setExecutionSet(new CustomTaskExecutionSet(new TaskName(serviceTaskPropertyReader.getTaskName()), new IsAsync(serviceTaskPropertyReader.isAsync()), new AdHocAutostart(serviceTaskPropertyReader.isAdHocAutoStart()), new OnEntryAction(serviceTaskPropertyReader.getOnEntryAction()), new OnExitAction(serviceTaskPropertyReader.getOnExitAction()), new SLADueDate(serviceTaskPropertyReader.getSlaDueDate())));
    definition.setSimulationSet(serviceTaskPropertyReader.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(serviceTaskPropertyReader.getMetaDataAttributes()));
    node.getContent().setBounds(serviceTaskPropertyReader.getBounds());
    definition.setDimensionsSet(serviceTaskPropertyReader.getRectangleDimensionsSet());
    definition.setBackgroundSet(serviceTaskPropertyReader.getBackgroundSet());
    definition.setFontSet(serviceTaskPropertyReader.getFontSet());
    return BpmnNode.of(node, serviceTaskPropertyReader);
}
Also used : ServiceTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ServiceTaskPropertyReader) GenericServiceTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GenericServiceTaskPropertyReader) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) CustomTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet) 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) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) TaskName(org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName) CustomTask(org.kie.workbench.common.stunner.bpmn.workitem.CustomTask) IsAsync(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync) Edge(org.kie.workbench.common.stunner.core.graph.Edge)

Aggregations

TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)2 CustomTask (org.kie.workbench.common.stunner.bpmn.workitem.CustomTask)2 CustomTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.workitem.CustomTaskExecutionSet)2 Task (org.eclipse.bpmn2.Task)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 ServiceTaskPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ServiceTaskPropertyWriter)1 GenericServiceTaskPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GenericServiceTaskPropertyReader)1 ServiceTaskPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ServiceTaskPropertyReader)1 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)1 Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)1 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)1 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)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 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)1 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)1 TaskName (org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName)1