Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.Pool


    String idPool = "idPool";
    String idProcess = "poolProcess";
   
    assertEquals(1, model.getPools().size());
   
    Pool pool = model.getPool(idPool);
    assertEquals(idPool, pool.getId());
    assertEquals(idProcess, pool.getProcessRef());
    assertTrue(pool.isExecutable());
   
    Process process = model.getProcess(idPool);
    assertEquals(idProcess, process.getId());
    assertTrue(process.isExecutable());
    assertEquals(3, process.getLanes().size());
View Full Code Here


    String idPool = "idPool";
    String idProcess = "poolProcess";
   
    assertEquals(1, model.getPools().size());
   
    Pool pool = model.getPool(idPool);
    assertEquals(idPool, pool.getId());
    assertEquals(idProcess, pool.getProcessRef());
    assertFalse(pool.isExecutable());
   
    Process process = model.getProcess(idPool);
    assertEquals(idProcess, process.getId());
    assertFalse(process.isExecutable());
    assertEquals(3, process.getLanes().size());
View Full Code Here

    FlowElement refElement = model.getFlowElement("DataStoreReference_1");
    assertNotNull(refElement);
    assertTrue(refElement instanceof DataStoreReference);
   
    assertEquals(1, model.getPools().size());
    Pool pool = model.getPools().get(0);
    assertEquals("pool1", pool.getId());
  }
View Full Code Here

    return "pools.bpmn";
  }
 
  private void validateModel(BpmnModel model) {
    assertEquals(1, model.getPools().size());
    Pool pool = model.getPools().get(0);
    assertEquals("pool1", pool.getId());
    assertEquals("Pool", pool.getName());
    Process process = model.getProcess(pool.getId());
    assertNotNull(process);
    assertEquals(2, process.getLanes().size());
    Lane lane = process.getLanes().get(0);
    assertEquals("lane1", lane.getId());
    assertEquals("Lane 1", lane.getName());
View Full Code Here

    assertEquals("test 2", messageFlow.getName());
    assertEquals("task2", messageFlow.getSourceRef());
    assertEquals("task3", messageFlow.getTargetRef());
   
    assertEquals(2, model.getPools().size());
    Pool pool = model.getPools().get(0);
    assertEquals("participant1", pool.getId());
    assertEquals("Participant 1", pool.getName());
    assertEquals("PROCESS_1", pool.getProcessRef());
   
    pool = model.getPools().get(1);
    assertEquals("participant2", pool.getId());
    assertEquals("Participant 2", pool.getName());
    assertEquals("PROCESS_2", pool.getProcessRef());
  }
View Full Code Here

    boolean emptyPoolFound = true;
    // first create the pool structure
    for (JsonNode shapeNode : shapesArrayNode) {
      String stencilId = BpmnJsonConverterUtil.getStencilId(shapeNode);
      if (STENCIL_POOL.equals(stencilId)) {
        Pool pool = new Pool();
        pool.setId(BpmnJsonConverterUtil.getElementId(shapeNode));
        pool.setName(JsonConverterUtil.getPropertyValueAsString(PROPERTY_NAME, shapeNode));
        pool.setProcessRef(JsonConverterUtil.getPropertyValueAsString(PROPERTY_PROCESS_ID, shapeNode));
        pool.setExecutable(JsonConverterUtil.getPropertyValueAsBoolean(PROPERTY_PROCESS_EXECUTABLE, shapeNode, true));
        bpmnModel.getPools().add(pool);
       
        Process process = new Process();
        process.setId(pool.getProcessRef());
        process.setName(pool.getName());
        process.setExecutable(pool.isExecutable());
        bpmnModel.addProcess(process);
       
        processJsonElements(shapesArrayNode, modelNode, process, shapeMap);
       
        ArrayNode laneArrayNode = (ArrayNode) shapeNode.get(EDITOR_CHILD_SHAPES);
View Full Code Here

  protected static final Logger LOGGER = LoggerFactory.getLogger(ParticipantParser.class.getName());
 
  public void parse(XMLStreamReader xtr, BpmnModel model) throws Exception {
   
    if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_ID))) {
      Pool pool = new Pool();
      pool.setId(xtr.getAttributeValue(null, ATTRIBUTE_ID));
      pool.setName(xtr.getAttributeValue(null, ATTRIBUTE_NAME));
      pool.setProcessRef(xtr.getAttributeValue(null, ATTRIBUTE_PROCESS_REF));
      BpmnXMLUtil.parseChildElements(ELEMENT_PARTICIPANT, pool, xtr, model);
      model.getPools().add(pool);
    }
  }
View Full Code Here

  @Override
  public Object[] create(ICreateContext context) {

    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
    Object parentBo = getFeatureProvider().getBusinessObjectForPictogramElement(context.getTargetContainer());
    Pool parentPool = null;
    if (parentBo instanceof Pool) {
      parentPool = (Pool) parentBo;
    } else {
      Lane lane = (Lane) parentBo;
      for (Pool pool : model.getBpmnModel().getPools()) {
        if (pool.getProcessRef().equals(lane.getParentProcess().getId())) {
          parentPool = pool;
          break;
        }
      }
    }

    if (parentPool == null)
      return null;

    ContainerShape poolShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(parentPool);
    Process poolProcess = model.getBpmnModel().getProcess(parentPool.getId());

    if (poolProcess == null)
      return null;

    List<Lane> lanes = poolProcess.getLanes();
View Full Code Here

    return false;
  }

  @Override
  public Object[] create(ICreateContext context) {
    Pool newPool = new Pool();
    newPool.setId(getNextId(newPool));
    newPool.setName("Pool");

    Process newProcess = new Process();
    newProcess.setId("process_" + newPool.getId());
    newProcess.setName(newProcess.getId());

    newPool.setProcessRef(newProcess.getId());

    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
    model.getBpmnModel().getPools().add(newPool);
    model.getBpmnModel().addProcess(newProcess);
View Full Code Here

  protected void deleteBusinessObject(Object bo) {
    if (bo instanceof Lane) {
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      Lane lane = (Lane) bo;
     
      Pool parentPool = null;
      for (Pool pool : model.getBpmnModel().getPools()) {
        if(pool.getProcessRef().equalsIgnoreCase(lane.getParentProcess().getId())) {
          parentPool = pool;
          break;
        }
      }
     
      Process laneProcess = model.getBpmnModel().getProcess(parentPool.getId());
     
      if (parentPool == null || laneProcess == null) return;
     
      if(laneProcess.getLanes().size() == 1) {
        Process process = model.getBpmnModel().getProcess(parentPool.getId());
        model.getBpmnModel().getProcesses().remove(process);
        model.getBpmnModel().getPools().remove(parentPool);
        PictogramElement poolElement = getFeatureProvider().getPictogramElementForBusinessObject(parentPool);
        IRemoveContext poolRc = new RemoveContext(poolElement);
        IRemoveFeature poolRemoveFeature = getFeatureProvider().getRemoveFeature(poolRc);
View Full Code Here

TOP

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

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.