public boolean handle(FlowElement element, PathContextManager manager) { this.manager = manager; if (element instanceof ExclusiveGateway) { return false; } else if (element instanceof InclusiveGateway) { return true; } else if (element instanceof ParallelGateway) { handleParallelGateway(element, getOutgoing(element)); return true; } else { throw new UnsupportedOperationException("Not supported element to handle " + element.eClass().getName()); } }
@Override public java.lang.String getValue(BaseElement element) { String defaultValue = element instanceof FlowElement ? ((FlowElement) element).getName() : this.defaultValue; return getStringValue(element).orElse(defaultValue); } };
public static void printOutPaths(List<PathContext> paths, String name) { if (!"true".equalsIgnoreCase(System.getProperty("test.debug.off"))) { System.out.println("###################" + name + "###################"); for (PathContext context : paths) { System.out.println("PATH: " + context.getId()); System.out.println("AS TEXT:"); for (FlowElement fe : context.getPathElements()) { System.out.println(fe.getName() + " - " + fe.eClass().getName()); } } System.out.println("#####################################################"); } }
for (FlowElement fe : laneFlowNodes) { if (fe instanceof ServiceTask) { Iterator<FeatureMap.Entry> iter = fe.getAnyAttribute().iterator(); String serviceImplementation = null; String serviceInterface = null; touseInterface = Bpmn2Factory.eINSTANCE.createInterface(); if (serviceInterface == null || serviceInterface.length() == 0) { serviceInterface = fe.getId() + "_ServiceInterface"; if (serviceInterfaceFeature != null) { fe.getAnyAttribute().set(serviceInterfaceFeature, serviceInterface); touseInterface.setId(fe.getId() + "_ServiceInterface"); toAddInterfaces.add(touseInterface); Operation touseOperation = Bpmn2Factory.eINSTANCE.createOperation(); if (serviceOperation == null || serviceOperation.length() == 0) { serviceOperation = fe.getId() + "_ServiceOperation"; if (serviceOperationFeature != null) { fe.getAnyAttribute().set(serviceOperationFeature, serviceOperation); touseOperation.setId(fe.getId() + "_ServiceOperation"); touseOperation.setName(serviceOperation); touseOperation.setImplementationRef(serviceOperation); Message message = Bpmn2Factory.eINSTANCE.createMessage(); message.setId(fe.getId() + "_InMessage"); ItemDefinition itemdef = Bpmn2Factory.eINSTANCE.createItemDefinition();
@Before public void setUp() { when(propertyWriter.getRootElements()).thenReturn(propertyWriterRootElements); when(propertyWriter.getSimulationParameters()).thenReturn(propertyWriterElementParameters); when(propertyWriter.getItemDefinitions()).thenReturn(propertyWriterItemDefinitions); when(boundaryEventPropertyWriter.getRootElements()).thenReturn(propertyWriterRootElements); when(boundaryEventPropertyWriter.getSimulationParameters()).thenReturn(propertyWriterElementParameters); when(boundaryEventPropertyWriter.getItemDefinitions()).thenReturn(propertyWriterItemDefinitions); flowElement = new FlowElementImpl() {}; flowElement.setId(ELEMENT_ID); artifact = new ArtifactImpl() {}; artifact.setId(ELEMENT_ID); when(process.getFlowElements()).thenReturn(flowElements); when(process.getArtifacts()).thenReturn(artifacts); when(subProcess.getFlowElements()).thenReturn(flowElements); when(subProcess.getArtifacts()).thenReturn(artifacts); }
private boolean isParentEventSubprocess(FlowElement fe) { if (fe.eContainer() instanceof SubProcess && ((SubProcess) fe.eContainer()).isTriggeredByEvent()){ return true; } return false; }
public static void printOutPaths(List<PathContext> paths, String name) { if (!"true".equalsIgnoreCase(System.getProperty("test.debug.off"))) { System.out.println("###################" + name + "###################"); for (PathContext context : paths) { System.out.println("PATH: " + context.getId()); System.out.println("AS TEXT:"); for (FlowElement fe : context.getPathElements()) { System.out.println(fe.getName() + " - " + fe.eClass().getName()); } } System.out.println("#####################################################"); } }
for (FlowElement fe : flowElements) { if (fe instanceof ServiceTask) { Iterator<FeatureMap.Entry> iter = fe.getAnyAttribute().iterator(); String serviceImplementation = null; String serviceInterface = null; touseInterface = Bpmn2Factory.eINSTANCE.createInterface(); if (serviceInterface == null || serviceInterface.length() == 0) { serviceInterface = fe.getId() + "_ServiceInterface"; if (serviceInterfaceFeature != null) { fe.getAnyAttribute().set(serviceInterfaceFeature, serviceInterface); touseInterface.setId(fe.getId() + "_ServiceInterface"); toAddInterfaces.add(touseInterface); Operation touseOperation = Bpmn2Factory.eINSTANCE.createOperation(); if (serviceOperation == null || serviceOperation.length() == 0) { serviceOperation = fe.getId() + "_ServiceOperation"; if (serviceOperationFeature != null) { fe.getAnyAttribute().set(serviceOperationFeature, serviceOperation); touseOperation.setId(fe.getId() + "_ServiceOperation"); touseOperation.setName(serviceOperation); touseOperation.setImplementationRef(serviceOperation); Message message = Bpmn2Factory.eINSTANCE.createMessage(); message.setId(fe.getId() + "_InMessage"); ItemDefinition itemdef = Bpmn2Factory.eINSTANCE.createItemDefinition();
private PropertyWriter compensationEvent(Node<View<IntermediateCompensationEvent>, ?> n) { CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); p.getFlowElement().setId(n.getUUID()); IntermediateCompensationEvent definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.addCompensation(); p.setBounds(n.getContent().getBounds()); return p; }
private boolean isParentEventSubprocess(FlowElement fe) { if (fe.eContainer() instanceof SubProcess && ((SubProcess) fe.eContainer()).isTriggeredByEvent()){ return true; } return false; }
public static void printOutPaths(List<PathContext> paths, String name) { if (!"true".equalsIgnoreCase(System.getProperty("test.debug.off"))) { System.out.println("###################" + name + "###################"); for (PathContext context : paths) { System.out.println("PATH: " + context.getId()); System.out.println("AS TEXT:"); for (FlowElement fe : context.getPathElements()) { System.out.println(fe.getName() + " - " + fe.eClass().getName()); } } System.out.println("#####################################################"); } }
generator.writeStartObject(); generator.writeObjectField("resourceId", flowElement.getId()); Map<String, Object> flowElementProperties = new LinkedHashMap<String, Object>(); Iterator<FeatureMap.Entry> iter = flowElement.getAnyAttribute().iterator(); boolean foundBgColor = false; boolean foundBrColor = false;
public boolean handle(FlowElement element, PathContextManager manager) { this.manager = manager; if (element instanceof ExclusiveGateway) { return false; } else if (element instanceof InclusiveGateway) { return true; } else if (element instanceof ParallelGateway) { handleParallelGateway(element, getOutgoing(element)); return true; } else { throw new UnsupportedOperationException("Not supported element to handle " + element.eClass().getName()); } }
public String getName() { String extendedName = CustomElement.name.of(element).get(); return extendedName == null || extendedName.isEmpty() ? Optional.ofNullable(flowElement.getName()).orElse("") : extendedName; } }
private PropertyWriter conditionalEvent(Node<View<IntermediateConditionalEvent>, ?> n) { CatchEventPropertyWriter p = createCatchEventPropertyWriter(n); p.getFlowElement().setId(n.getUUID()); IntermediateConditionalEvent definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); CancellingConditionalEventExecutionSet executionSet = definition.getExecutionSet(); p.setCancelActivity(executionSet.getCancelActivity().getValue()); p.addCondition(executionSet.getConditionExpression()); p.setBounds(n.getContent().getBounds()); return p; }