use of org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet in project kie-wb-common by kiegroup.
the class TaskConverter method userTask.
private PropertyWriter userTask(Node<View<UserTask>, ?> n) {
org.eclipse.bpmn2.UserTask task = bpmn2.createUserTask();
task.setId(n.getUUID());
UserTask definition = n.getContent().getDefinition();
UserTaskPropertyWriter p = propertyWriterFactory.of(task);
TaskGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setSimulationSet(definition.getSimulationSet());
UserTaskExecutionSet executionSet = definition.getExecutionSet();
p.setTaskName(executionSet.getTaskName().getValue());
p.setActors(executionSet.getActors());
p.setGroupId(executionSet.getGroupid().getValue());
p.setAssignmentsInfo(executionSet.getAssignmentsinfo());
p.setAsync(executionSet.getIsAsync().getValue());
p.setSkippable(executionSet.getSkippable().getValue());
p.setPriority(executionSet.getPriority().getValue());
p.setSubject(executionSet.getSubject().getValue());
p.setDescription(executionSet.getDescription().getValue());
p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
p.setCreatedBy(executionSet.getCreatedBy().getValue());
p.setOnEntryAction(executionSet.getOnEntryAction());
p.setOnExitAction(executionSet.getOnExitAction());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet in project kie-wb-common by kiegroup.
the class TaskConverter method userTask.
private BpmnNode userTask(org.eclipse.bpmn2.UserTask task) {
Node<View<UserTask>, Edge> node = factoryManager.newNode(task.getId(), UserTask.class);
UserTask 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.setExecutionSet(new UserTaskExecutionSet(new TaskName(p.getTaskName()), p.getActors(), new Groupid(p.getGroupid()), p.getAssignmentsInfo(), new IsAsync(p.isAsync()), new Skippable(p.isSkippable()), new Priority(p.getPriority()), new Subject(p.getSubject()), new Description(p.getDescription()), new CreatedBy(p.getCreatedBy()), new AdHocAutostart(p.isAdHocAutostart()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction())));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallUserTaskAssignments.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallUserTaskAssignments() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_USERTASKASSIGNMENTS);
assertDiagram(diagram, 8);
assertEquals("UserTaskAssignments", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> selfEvaluationNode = diagram.getGraph().getNode("_6063D302-9D81-4C86-920B-E808A45377C2");
UserTask selfEvaluationTask = (UserTask) selfEvaluationNode.getContent().getDefinition();
assertEquals(selfEvaluationTask.getTaskType().getValue(), TaskTypes.USER);
UserTaskExecutionSet executionSet = selfEvaluationTask.getExecutionSet();
AssignmentsInfo assignmentsinfo = executionSet.getAssignmentsinfo();
assertEquals(assignmentsinfo.getValue(), "|reason:com.test.Reason,Comment:Object,Skippable:Object||performance:Object|[din]reason->reason,[dout]performance->performance");
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallUserTaskAssignees.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallUserTaskAssignees() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_USERTASKASSIGNEES);
assertDiagram(diagram, 6);
assertEquals("UserGroups", diagram.getMetadata().getTitle());
UserTaskExecutionSet executionSet = null;
Iterator<Element> it = nodesIterator(diagram);
while (it.hasNext()) {
Element element = it.next();
if (element.getContent() instanceof View) {
Object oDefinition = ((View) element.getContent()).getDefinition();
if (oDefinition instanceof UserTask) {
UserTask userTask = (UserTask) oDefinition;
executionSet = userTask.getExecutionSet();
break;
}
}
}
assertEquals("user,user1", executionSet.getActors().getValue());
assertEquals("admin,kiemgmt", executionSet.getGroupid().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallUserTaskAssignments.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallUserTaskAssignments() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_USERTASKASSIGNMENTS);
assertDiagram(diagram, 8);
assertEquals("UserTaskAssignments", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> selfEvaluationNode = diagram.getGraph().getNode("_6063D302-9D81-4C86-920B-E808A45377C2");
UserTask selfEvaluationTask = (UserTask) selfEvaluationNode.getContent().getDefinition();
assertEquals(selfEvaluationTask.getTaskType().getValue(), TaskTypes.USER);
UserTaskExecutionSet executionSet = selfEvaluationTask.getExecutionSet();
AssignmentsInfo assignmentsinfo = executionSet.getAssignmentsinfo();
assertEquals(assignmentsinfo.getValue(), "|reason:com.test.Reason,Comment:Object,Skippable:Object||performance:Object|[din]reason->reason,[dout]performance->performance");
}
Aggregations