use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData 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.variables.AdvancedData 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData in project kie-wb-common by kiegroup.
the class TaskConverterPriorityTest method setPriorityEscapeSpecialChars.
@Test
public void setPriorityEscapeSpecialChars() {
propertyWriterFactory = new PropertyWriterFactory();
taskConverter = spy(new TaskConverter(propertyWriterFactory));
when(n.getContent()).thenReturn(view);
when(view.getBounds()).thenReturn(Bounds.create(0, 0, 10, 10));
when(view.getDefinition()).thenReturn(definition);
when(general.getName()).thenReturn(new Name("Name"));
when(general.getDocumentation()).thenReturn(new Documentation());
when(definition.getGeneral()).thenReturn(general);
when(definition.getSimulationSet()).thenReturn(new SimulationSet());
when(definition.getExecutionSet()).thenReturn(baseUserTaskExecutionSet);
when(baseUserTaskExecutionSet.getTaskName()).thenReturn(new TaskName("taskName"));
when(baseUserTaskExecutionSet.getActors()).thenReturn(new Actors());
when(baseUserTaskExecutionSet.getAssignmentsinfo()).thenReturn(new AssignmentsInfo());
when(baseUserTaskExecutionSet.getReassignmentsInfo()).thenReturn(new ReassignmentsInfo());
when(baseUserTaskExecutionSet.getNotificationsInfo()).thenReturn(new NotificationsInfo());
when(baseUserTaskExecutionSet.getSkippable()).thenReturn(new Skippable(true));
when(baseUserTaskExecutionSet.getGroupid()).thenReturn(new Groupid("groupId"));
when(baseUserTaskExecutionSet.getSubject()).thenReturn(new Subject());
when(baseUserTaskExecutionSet.getDescription()).thenReturn(new Description());
when(baseUserTaskExecutionSet.getPriority()).thenReturn(new TaskPriority("#{varOne<>&\"}"));
when(baseUserTaskExecutionSet.getIsAsync()).thenReturn(new IsAsync(true));
when(baseUserTaskExecutionSet.getCreatedBy()).thenReturn(new CreatedBy());
when(baseUserTaskExecutionSet.getAdHocAutostart()).thenReturn(new AdHocAutostart());
when(baseUserTaskExecutionSet.getIsMultipleInstance()).thenReturn(new IsMultipleInstance(false));
when(baseUserTaskExecutionSet.getOnEntryAction()).thenReturn(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getOnExitAction()).thenReturn(new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getContent()).thenReturn(new Content());
when(baseUserTaskExecutionSet.getSlaDueDate()).thenReturn(new SLADueDate());
when(definition.getAdvancedData()).thenReturn(new AdvancedData(new MetaDataAttributes()));
doCallRealMethod().when(taskConverter).userTask(any());
final UserTaskPropertyWriter propertyWriter = (UserTaskPropertyWriter) taskConverter.userTask(n);
assertTrue(propertyWriter.getPriority().equals("<![CDATA[#{varOne<>&"}]]>"));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData in project kie-wb-common by kiegroup.
the class BaseTaskTest method testGetAdvancedData.
@Test
public void testGetAdvancedData() {
final FakeBaseTask baseTask = new FakeBaseTask(null, null, null, null, null, null, advancedData);
AdvancedData result = baseTask.getAdvancedData();
assertEquals(advancedData, result);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testIntermediateEscalationThrowingEventEqualsAndHashCode.
@Test
public void testIntermediateEscalationThrowingEventEqualsAndHashCode() {
String ESCALATION_REF = "ESCALATION_REF";
String ESCALATION_REF_1 = "ESCALATION_REF_1";
TestCaseBuilder.newTestCase().addTrueCase(new IntermediateEscalationEventThrowing(), new IntermediateEscalationEventThrowing()).addTrueCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet()), new IntermediateEscalationEventThrowing(new BPMNGeneralSet(), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet())).addFalseCase(new IntermediateEscalationEventThrowing(), null).addTrueCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet()), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet())).addTrueCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)))).addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name1", "doc1"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF)))).addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF_1)))).addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(null))).addFalseCase(new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), new EscalationEventExecutionSet(new EscalationRef(ESCALATION_REF))), new IntermediateEscalationEventThrowing(new BPMNGeneralSet("name", "doc"), new BackgroundSet(), new FontSet(), new CircleDimensionSet(), new DataIOSet(), new AdvancedData(), null)).test();
}
Aggregations