use of org.kie.workbench.common.stunner.core.graph.content.view.View in project kie-wb-common by kiegroup.
the class BPMNGraphGenerator method createGraph.
public Graph<DefinitionSet, Node> createGraph() {
Graph<DefinitionSet, Node> graph = (Graph<DefinitionSet, Node>) factoryManager.newElement(UUID.uuid(), diagramDefinitionSetClass);
// TODO: Where are the BPMN diagram bounds in the Oryx json structure? Exist?
if (null == graph.getContent().getBounds()) {
graph.getContent().setBounds(new BoundsImpl(new BoundImpl(0d, 0d), new BoundImpl(BPMNGraphFactory.GRAPH_DEFAULT_WIDTH, BPMNGraphFactory.GRAPH_DEFAULT_HEIGHT)));
}
builderContext.init(graph).execute(builderContext.getCommandFactory().clearGraph());
NodeObjectBuilder diagramBuilder = getDiagramBuilder(builderContext);
if (diagramBuilder == null) {
throw new RuntimeException("No diagrams found!");
}
Node<View<BPMNDefinition>, Edge> diagramNode = (Node<View<BPMNDefinition>, Edge>) diagramBuilder.build(builderContext);
graph.addNode(diagramNode);
logBuilders();
return graph;
}
use of org.kie.workbench.common.stunner.core.graph.content.view.View in project kie-wb-common by kiegroup.
the class ServiceTaskNodeBuilder method doBuild.
@Override
protected Node<View<BPMNDefinition>, Edge> doBuild(final BuilderContext context) {
final Node<View<BPMNDefinition>, Edge> node = super.doBuild(context);
final ServiceTask serviceTask = (ServiceTask) node.getContent().getDefinition();
// Oryx handles the taskName property, use it for populating the service task.
final String taskName = serviceTask.getExecutionSet().getTaskName().getValue();
final WorkItemDefinition workItemDefinition = workItemDefinitionRegistry.get().get(taskName);
ServiceTaskFactory.ServiceTaskBuilder.setProperties(workItemDefinition, serviceTask);
return node;
}
use of org.kie.workbench.common.stunner.core.graph.content.view.View in project kie-wb-common by kiegroup.
the class EndEventConverter method endNoneEvent.
private BpmnNode endNoneEvent(EndEvent event) {
Node<View<EndNoneEvent>, Edge> node = factoryManager.newNode(event.getId(), EndNoneEvent.class);
EndNoneEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.View in project kie-wb-common by kiegroup.
the class EndEventConverter method errorEventDefinition.
private BpmnNode errorEventDefinition(EndEvent event, ErrorEventDefinition e) {
Node<View<EndErrorEvent>, Edge> node = factoryManager.newNode(event.getId(), EndErrorEvent.class);
EndErrorEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new ErrorEventExecutionSet(new ErrorRef(e.getErrorRef().getErrorCode())));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.View in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method errorEvent.
private BpmnNode errorEvent(CatchEvent event, ErrorEventDefinition e) {
String nodeId = event.getId();
Node<View<IntermediateErrorEventCatching>, Edge> node = factoryManager.newNode(nodeId, IntermediateErrorEventCatching.class);
IntermediateErrorEventCatching definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setDataIOSet(new DataIOSet(p.getAssignmentsInfo()));
definition.setExecutionSet(new CancellingErrorEventExecutionSet(new CancelActivity(p.isCancelActivity()), new ErrorRef(e.getErrorRef().getErrorCode())));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}
Aggregations