Search in sources :

Example 41 with Documentation

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

the class DefinitionsConverterTest method JBPM_7526_shouldSetExporter.

@Test
public void JBPM_7526_shouldSetExporter() {
    GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl();
    NodeImpl x = new NodeImpl("x");
    BPMNDiagramImpl diag = new BPMNDiagramImpl();
    diag.setDiagramSet(new DiagramSet(new Name("x"), new Documentation("doc"), new Id("x"), new Package("org.jbpm"), new ProcessType(), new Version("1.0"), new AdHoc(false), new ProcessInstanceDescription("descr"), new Imports(), new Executable(true), new SLADueDate("")));
    x.setContent(new ViewImpl<>(diag, Bounds.create()));
    nodeStore.add(x);
    ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", nodeStore)), new PropertyWriterFactory());
    DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory());
    Definitions definitions = definitionsConverter.toDefinitions();
    assertThat(definitions.getExporter()).isNotBlank();
    assertThat(definitions.getExporterVersion()).isNotBlank();
}
Also used : NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) Definitions(org.eclipse.bpmn2.Definitions) ProcessInstanceDescription(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessInstanceDescription) Imports(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.imports.Imports) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) Name(org.kie.workbench.common.stunner.bpmn.definition.property.general.Name) GraphNodeStoreImpl(org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) ProcessType(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.ProcessType) Version(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Version) DiagramSet(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.DiagramSet) GraphImpl(org.kie.workbench.common.stunner.core.graph.impl.GraphImpl) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) Id(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Id) Package(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Package) AdHoc(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.AdHoc) Executable(org.kie.workbench.common.stunner.bpmn.definition.property.diagram.Executable) Test(org.junit.Test)

Example 42 with Documentation

use of org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation 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 43 with Documentation

use of org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation 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)

Example 44 with Documentation

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

the class BaseTaskConverter method userTask.

private BpmnNode userTask(org.eclipse.bpmn2.UserTask task) {
    Node<View<U>, Edge> node = createNode(task.getId());
    U definition = node.getContent().getDefinition();
    UserTaskPropertyReader p = propertyReaderFactory.of(task);
    definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    definition.setExecutionSet(createUserTaskExecutionSet(p));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    return BpmnNode.of(node, p);
}
Also used : AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) UserTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.UserTaskPropertyReader) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) 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)

Example 45 with Documentation

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

the class BaseTaskConverter method noneTask.

private BpmnNode noneTask(Task task) {
    Node<View<NoneTask>, Edge> node = factoryManager.newNode(task.getId(), NoneTask.class);
    TaskPropertyReader p = propertyReaderFactory.of(task);
    NoneTask definition = node.getContent().getDefinition();
    definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
    definition.setExecutionSet(new EmptyTaskExecutionSet());
    definition.setSimulationSet(p.getSimulationSet());
    definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
    node.getContent().setBounds(p.getBounds());
    definition.setDimensionsSet(p.getRectangleDimensionsSet());
    definition.setBackgroundSet(p.getBackgroundSet());
    definition.setFontSet(p.getFontSet());
    return BpmnNode.of(node, p);
}
Also used : AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) UserTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.UserTaskPropertyReader) ServiceTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ServiceTaskPropertyReader) GenericServiceTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.GenericServiceTaskPropertyReader) TaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.TaskPropertyReader) BusinessRuleTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.BusinessRuleTaskPropertyReader) ScriptTaskPropertyReader(org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ScriptTaskPropertyReader) NoneTask(org.kie.workbench.common.stunner.bpmn.definition.NoneTask) Documentation(org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) EmptyTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.EmptyTaskExecutionSet) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Edge(org.kie.workbench.common.stunner.core.graph.Edge) 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)

Aggregations

Documentation (org.kie.workbench.common.stunner.bpmn.definition.property.general.Documentation)67 Name (org.kie.workbench.common.stunner.bpmn.definition.property.general.Name)66 View (org.kie.workbench.common.stunner.core.graph.content.view.View)60 Edge (org.kie.workbench.common.stunner.core.graph.Edge)58 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)49 AdvancedData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData)49 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)28 SLADueDate (org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate)26 EventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.EventPropertyReader)22 CatchEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.CatchEventPropertyReader)17 IsAsync (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsAsync)15 ThrowEventPropertyReader (org.kie.workbench.common.stunner.bpmn.backend.converters.tostunner.properties.ThrowEventPropertyReader)13 TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)13 TaskName (org.kie.workbench.common.stunner.bpmn.definition.property.task.TaskName)13 OnEntryAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnEntryAction)11 OnExitAction (org.kie.workbench.common.stunner.bpmn.definition.property.task.OnExitAction)11 AdHocAutostart (org.kie.workbench.common.stunner.bpmn.definition.property.task.AdHocAutostart)9 CancelActivity (org.kie.workbench.common.stunner.bpmn.definition.property.event.CancelActivity)8 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)8 ProcessData (org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData)8