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();
}
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());
}
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);
}
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);
}
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);
}
Aggregations