use of org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask in project kie-wb-common by kiegroup.
the class AbstractDataTypeCacheTest method testExtractGenericServiceTask.
@Test
public void testExtractGenericServiceTask() {
GenericServiceTask genericServiceTask = new GenericServiceTask();
GenericServiceTask genericServiceTask2 = new GenericServiceTask();
when(firstView.getDefinition()).thenReturn(genericServiceTask);
when(lastView.getDefinition()).thenReturn(genericServiceTask2);
dataTypeCache.extractFromItem(firstView);
dataTypeCache.extractFromItem(lastView);
assertTrue(dataTypeCache.allDataTypes.contains("MyType"));
assertTrue(dataTypeCache.allDataTypes.contains("com.myspace.Person"));
}
use of org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask in project kie-wb-common by kiegroup.
the class GenericServiceTaskFilterProviderTest method newNonMultipleInstanceDefinition.
@Override
protected Object newNonMultipleInstanceDefinition() {
GenericServiceTask task = new GenericServiceTask();
task.getExecutionSet().getIsMultipleInstance().setValue(false);
return task;
}
use of org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask in project kie-wb-common by kiegroup.
the class GenericServiceTaskFilterProviderTest method newMultipleInstanceDefinition.
@Override
protected Object newMultipleInstanceDefinition() {
GenericServiceTask task = new GenericServiceTask();
task.getExecutionSet().getIsMultipleInstance().setValue(true);
return task;
}
use of org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask 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;
}
use of org.kie.workbench.common.stunner.bpmn.definition.GenericServiceTask in project kie-wb-common by kiegroup.
the class BaseTaskConverterTest method convertGenericServiceTask.
@Test
public void convertGenericServiceTask() {
org.eclipse.bpmn2.ServiceTask task = mock(org.eclipse.bpmn2.ServiceTask.class);
GenericServiceTaskPropertyReader genericServiceTaskPropertyReader = mock(GenericServiceTaskPropertyReader.class);
GenericServiceTask definition = new GenericServiceTask();
FeatureMap attributes = mock(FeatureMap.class);
FeatureMap.Entry ruleAttr = mock(FeatureMap.Entry.class);
EStructuralFeature ruleFeature = mock(EStructuralFeature.class);
when(factoryManager.newNode(any(), eq(GenericServiceTask.class))).thenReturn(genericServiceTaskNode);
when(genericServiceTaskNode.getContent()).thenReturn(genericServiceTaskContent);
when(genericServiceTaskContent.getDefinition()).thenReturn(definition);
when(propertyReaderFactory.of(task)).thenReturn(genericServiceTaskPropertyReader);
when(task.getAnyAttribute()).thenReturn(attributes);
when(attributes.stream()).thenReturn(Stream.of(ruleAttr));
when(ruleAttr.getEStructuralFeature()).thenReturn(ruleFeature);
when(ruleAttr.getValue()).thenReturn("Java");
when(ruleFeature.getName()).thenReturn(CustomAttribute.serviceImplementation.name());
final BpmnNode converted = (BpmnNode) tested.convert(task).value();
assertNotEquals(converted.value(), noneTaskNode);
assertEquals(converted.value(), genericServiceTaskNode);
}
Aggregations