Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.FlowElement


            bpmConfNode.setPriority(priority);
            bpmConfNode.setBpmConfBase(bpmConfBase);
            bpmConfNodeManager.save(bpmConfNode);
        }

        FlowElement flowElement = bpmnModel.getFlowElement(node.getId());
        // 配置监听器
        processListener(flowElement.getExecutionListeners(), bpmConfNode);
    }
View Full Code Here


            bpmConfNode.setPriority(priority);
            bpmConfNode.setBpmConfBase(bpmConfBase);
            bpmConfNodeManager.save(bpmConfNode);
        }

        FlowElement flowElement = bpmnModel.getFlowElement(node.getId());
        // 配置监听器
        processListener(flowElement.getExecutionListeners(), bpmConfNode);
    }
View Full Code Here

    //System.out.println("xml " + new String(new BpmnXMLConverter().convertToXML(bpmnModel), "utf-8"));
    validateModel(bpmnModel);
  }
 
  private void validateModel(BpmnModel model) {
  FlowElement flowElement = model.getMainProcess().getFlowElement("sid-B074A0DD-934A-4053-A537-20ADF0781023");
  assertNotNull(flowElement);
  assertTrue(flowElement instanceof ExclusiveGateway);
  ExclusiveGateway gateway = (ExclusiveGateway) flowElement;
  List<SequenceFlow> sequenceFlows = gateway.getOutgoingFlows();
  assertTrue(sequenceFlows.size() == 2);
View Full Code Here

  protected String getResource() {
    return "test.completemodel.json";
  }
 
  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElement("userTask1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("userTask1", flowElement.getId());
   
    flowElement = model.getMainProcess().getFlowElement("catchsignal");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof IntermediateCatchEvent);
    assertEquals("catchsignal", flowElement.getId());
    IntermediateCatchEvent catchEvent = (IntermediateCatchEvent) flowElement;
    assertEquals(1, catchEvent.getEventDefinitions().size());
    assertTrue(catchEvent.getEventDefinitions().get(0) instanceof SignalEventDefinition);
    SignalEventDefinition signalEvent = (SignalEventDefinition) catchEvent.getEventDefinitions().get(0);
    assertEquals("testSignal", signalEvent.getSignalRef());
   
    flowElement = model.getMainProcess().getFlowElement("subprocess");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess", flowElement.getId());
    SubProcess subProcess = (SubProcess) flowElement;
   
    flowElement = subProcess.getFlowElement("receiveTask");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof ReceiveTask);
    assertEquals("receiveTask", flowElement.getId());
  }
View Full Code Here

    return "test.catcheventmodel.json";
  }
 
  private void validateModel(BpmnModel model) {
   
    FlowElement timerElement = model.getMainProcess().getFlowElement("timer_evt");
    EventDefinition timerEvent = extractEventDefinition(timerElement);
    assertTrue(timerEvent instanceof TimerEventDefinition);
    TimerEventDefinition ted = (TimerEventDefinition)timerEvent;
    assertEquals("PT5M", ted.getTimeDuration());
   
    FlowElement signalElement = model.getMainProcess().getFlowElement("signal_evt");
    EventDefinition signalEvent = extractEventDefinition(signalElement);
    assertTrue(signalEvent instanceof SignalEventDefinition);
    SignalEventDefinition sed = (SignalEventDefinition)signalEvent;
    assertEquals("signal_ref", sed.getSignalRef());
   
    FlowElement messageElement = model.getMainProcess().getFlowElement("message_evt");
    EventDefinition messageEvent = extractEventDefinition(messageElement);
    assertTrue(messageEvent instanceof MessageEventDefinition);
    MessageEventDefinition med = (MessageEventDefinition)messageEvent;
    assertEquals("message_ref", med.getMessageRef());
   
View Full Code Here

  protected String getResource() {
    return "test.valueddataobjectmodel.json";
  }
 
  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElement("start1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof StartEvent);
    assertEquals("start1", flowElement.getId());
   
    // verify main process data objects
    List<ValuedDataObject> dataObjects = model.getMainProcess().getDataObjects();
    assertEquals(6, dataObjects.size());
    for (ValuedDataObject dObj : dataObjects) {
      if ("dObj1".equals(dObj.getId())) {
        assertEquals(StringDataObject.class, dObj.getClass());
        assertEquals("StringTest", dObj.getName());
        assertTrue(dObj.getValue() instanceof String);
        assertEquals("xsd:string", dObj.getItemSubjectRef().getStructureRef());
        assertEquals("Testing123", dObj.getValue());
      } else if ("dObj2".equals(dObj.getId())) {
        assertEquals(BooleanDataObject.class, dObj.getClass());
        assertEquals("BooleanTest", dObj.getName());
        assertEquals("xsd:boolean", dObj.getItemSubjectRef().getStructureRef());
        assertTrue(dObj.getValue() instanceof Boolean);
        assertEquals(new Boolean(true), dObj.getValue());
      } else if ("dObj3".equals(dObj.getId())) {
        assertEquals(DateDataObject.class, dObj.getClass());
        assertEquals("DateTest", dObj.getName());
        assertEquals("xsd:datetime", dObj.getItemSubjectRef().getStructureRef());
        assertTrue(dObj.getValue() instanceof Date);
        GregorianCalendar dateCal = new GregorianCalendar();
        dateCal.setTime((Date) dObj.getValue());
        assertEquals(2013, dateCal.get(Calendar.YEAR));
        assertEquals(8, dateCal.get(Calendar.MONTH));
        assertEquals(16, dateCal.get(Calendar.DAY_OF_MONTH));
        assertEquals(11, dateCal.get(Calendar.HOUR_OF_DAY));
        assertEquals(23, dateCal.get(Calendar.MINUTE));
      } else if ("dObj4".equals(dObj.getId())) {
        assertEquals(DoubleDataObject.class, dObj.getClass());
        assertEquals("DoubleTest", dObj.getName());
        assertEquals("xsd:double", dObj.getItemSubjectRef().getStructureRef());
        assertTrue(dObj.getValue() instanceof Double);
        assertEquals(new Double(123456789), dObj.getValue());
      } else if ("dObj5".equals(dObj.getId())) {
        assertEquals(IntegerDataObject.class, dObj.getClass());
        assertEquals("IntegerTest", dObj.getName());
        assertEquals("xsd:int", dObj.getItemSubjectRef().getStructureRef());
        assertTrue(dObj.getValue() instanceof Integer);
        assertEquals(new Integer(123), dObj.getValue());
      } else if ("dObj6".equals(dObj.getId())) {
        assertEquals(LongDataObject.class, dObj.getClass());
        assertEquals("LongTest", dObj.getName());
        assertEquals("xsd:long", dObj.getItemSubjectRef().getStructureRef());
        assertTrue(dObj.getValue() instanceof Long);
        assertEquals(new Long(-123456), dObj.getValue());
      }
    }
   
    flowElement = model.getMainProcess().getFlowElement("subprocess1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess1", flowElement.getId());
    SubProcess subProcess = (SubProcess) flowElement;
    assertEquals(11, subProcess.getFlowElements().size());

    // verify subprocess data objects
    dataObjects = ((SubProcess)flowElement).getDataObjects();
View Full Code Here

  protected String getResource() {
    return "test.subprocessmodel.json";
  }
 
  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElement("start1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof StartEvent);
    assertEquals("start1", flowElement.getId());
   
    flowElement = model.getMainProcess().getFlowElement("userTask1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("userTask1", flowElement.getId());
    UserTask userTask = (UserTask) flowElement;
    assertTrue(userTask.getCandidateUsers().size() == 1);
    assertTrue(userTask.getCandidateGroups().size() == 1);
    assertTrue(userTask.getFormProperties().size() == 2);
   
    flowElement = model.getMainProcess().getFlowElement("subprocess1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("subprocess1", flowElement.getId());
    SubProcess subProcess = (SubProcess) flowElement;
    assertTrue(subProcess.getFlowElements().size() == 5);
   
    flowElement = model.getMainProcess().getFlowElement("boundaryEvent1");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof BoundaryEvent);
    assertEquals("boundaryEvent1", flowElement.getId());
    BoundaryEvent boundaryEvent = (BoundaryEvent) flowElement;
    assertNotNull(boundaryEvent.getAttachedToRef());
    assertEquals("subprocess1", boundaryEvent.getAttachedToRef().getId());
    assertEquals(1, boundaryEvent.getEventDefinitions().size());
    assertTrue(boundaryEvent.getEventDefinitions().get(0) instanceof TimerEventDefinition);
View Full Code Here

  protected String getResource() {
    return "test.scopedmodel.json";
  }
 
  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElement("outerSubProcess");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof SubProcess);
    assertEquals("outerSubProcess", flowElement.getId());
    SubProcess outerSubProcess = (SubProcess) flowElement;
    List<BoundaryEvent> eventList = outerSubProcess.getBoundaryEvents();
    assertEquals(1, eventList.size());
    BoundaryEvent boundaryEvent = eventList.get(0);
    assertEquals("outerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement subElement = outerSubProcess.getFlowElement("innerSubProcess");
    assertNotNull(subElement);
    assertTrue(subElement instanceof SubProcess);
    assertEquals("innerSubProcess", subElement.getId());
    SubProcess innerSubProcess = (SubProcess) subElement;
    eventList = innerSubProcess.getBoundaryEvents();
    assertEquals(1, eventList.size());
    boundaryEvent = eventList.get(0);
    assertEquals("innerBoundaryEvent", boundaryEvent.getId());
   
    FlowElement taskElement = innerSubProcess.getFlowElement("usertask");
    assertNotNull(taskElement);
    assertTrue(taskElement instanceof UserTask);
    UserTask userTask = (UserTask) taskElement;
    assertEquals("usertask", userTask.getId());
    eventList = userTask.getBoundaryEvents();
View Full Code Here

    //System.out.println("xml " + new String(new BpmnXMLConverter().convertToXML(bpmnModel), "utf-8"));
    validateModel(bpmnModel);
  }
 
  private void validateModel(BpmnModel model) {
  FlowElement flowElement = model.getMainProcess().getFlowElement("parallel1");
  assertNotNull(flowElement);
  assertTrue(flowElement instanceof ParallelGateway);
  ParallelGateway gateway = (ParallelGateway) flowElement;
  List<SequenceFlow> sequenceFlows = gateway.getOutgoingFlows();
  assertTrue(sequenceFlows.size() == 3);
View Full Code Here

  protected String getResource() {
    return "test.usertaskmodel.json";
  }
 
  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElement("usertask");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof UserTask);
    assertEquals("usertask", flowElement.getId());
    UserTask userTask = (UserTask) flowElement;
    assertEquals("usertask", userTask.getId());
    assertEquals("User task", userTask.getName());
    assertEquals("testKey", userTask.getFormKey());
    assertEquals("40", userTask.getPriority());
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.FlowElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.