Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.Pool


    } else if(bo instanceof SequenceFlow) {
      ((SequenceFlow) bo).getExecutionListeners().remove(listener);
    } else if(bo instanceof Process) {
      ((Process) bo).getExecutionListeners().remove(listener);
    } else if(bo instanceof Pool) {
      Pool pool = ((Pool) bo);
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(diagram));
      model.getBpmnModel().getProcess(pool.getId()).getExecutionListeners().remove(listener);
    }
  }
View Full Code Here


        process = model.getBpmnModel().getMainProcess();
        setEnabled(true);
      }
   
    } else {
      Pool pool = ((Pool) getBusinessObject(getSelectedPictogramElement()));
      process = model.getBpmnModel().getProcess(pool.getId());
      setEnabled(true);
    }
   
    if(StringUtils.isNotEmpty(model.getBpmnModel().getTargetNamespace())) {
      namespaceText.setText(model.getBpmnModel().getTargetNamespace());
View Full Code Here

          }
         
        } else if (ELEMENT_PARTICIPANT.equalsIgnoreCase(xtr.getLocalName())) {
         
          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));
            model.getPools().add(pool);
          }

        } else if (ELEMENT_PROCESS.equalsIgnoreCase(xtr.getLocalName())) {
         
View Full Code Here

    } else if(bo instanceof SequenceFlow) {
      listenerList = ((SequenceFlow) bo).getExecutionListeners();
    } else if(bo instanceof Process) {
      listenerList = ((Process) bo).getExecutionListeners();
    } else if(bo instanceof Pool) {
      Pool pool = ((Pool) bo);
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(diagram));
      listenerList = model.getBpmnModel().getProcess(pool.getId()).getExecutionListeners();
    }
    return listenerList;
  }
View Full Code Here

  }

  @Override
  public PictogramElement add(IAddContext context) {

    final Pool addedPool = (Pool) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH ROUNDED RECTANGLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 500 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 150 : context.getHeight();

    final IGaService gaService = Graphiti.getGaService();
    {
      // create invisible outer rectangle expanded by
      // the width needed for the anchor
      final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
      gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);

      // create and set visible rectangle inside invisible rectangle
      Rectangle rectangle = gaService.createRectangle(invisibleRectangle);
      rectangle.setParentGraphicsAlgorithm(invisibleRectangle);
      rectangle.setStyle(StyleUtil.getStyleForPool(getDiagram()));
      gaService.setLocationAndSize(rectangle, 0, 0, width, height);

      // create link and wire it
      link(containerShape, addedPool);
    }

    // SHAPE WITH TEXT
    {
      // create shape for text
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      final Text text = gaService.createDefaultText(getDiagram(), shape, addedPool.getName());
      text.setStyle(StyleUtil.getStyleForEvent(getDiagram()));
      text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
      text.setVerticalAlignment(Orientation.ALIGNMENT_MIDDLE);
      gaService.setLocationAndSize(text, 0, 0, 20, height);
      text.setAngle(-90);
View Full Code Here

    } else if(bo instanceof SequenceFlow) {
      ((SequenceFlow) bo).getExecutionListeners().add(listener);
    } else if(bo instanceof Process) {
      ((Process) bo).getExecutionListeners().add(listener);
    } else if(bo instanceof Pool) {
      Pool pool = ((Pool) bo);
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(diagram));
      model.getBpmnModel().getProcess(pool.getId()).getExecutionListeners().add(listener);
    }
  }
View Full Code Here

    } else if(bo instanceof SequenceFlow) {
      ((SequenceFlow) bo).getExecutionListeners().set(index, listener);
    } else if(bo instanceof Process) {
      ((Process) bo).getExecutionListeners().set(index, listener);
    } else if(bo instanceof Pool) {
      Pool pool = ((Pool) bo);
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(diagram));
      model.getBpmnModel().getProcess(pool.getId()).getExecutionListeners().set(index, listener);
    }
  }
View Full Code Here

  }

  private Process findParentProcess() {
    Process result = null;

    final Pool parentPool = findParentPool();
    if (parentPool != null) {
      final String poolId = parentPool.getId();

      final Bpmn2MemoryModel bpmn2MemoryModel = findRootModel();

      result = bpmn2MemoryModel.getBpmnModel().getProcess(poolId);
View Full Code Here

    }
    return result;
  }

  private Pool findParentPool() {
    Pool result = null;

    if (getParentNode() instanceof AbstractDiagramTreeNode) {
      final Object modelObject = ((AbstractDiagramTreeNode< ? >) getParentNode()).getModelObject();
      if (modelObject instanceof Pool) {
        result = (Pool) modelObject;
View Full Code Here

   
    for (final PictogramElement pictogramElement : context.getPictogramElements()) {
      if(getBusinessObjectForPictogramElement(pictogramElement) == null) continue;
      final Object boObject = getBusinessObjectForPictogramElement(pictogramElement);
      if(boObject instanceof Pool == true) {
        final Pool pool = (Pool) boObject;
        Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
        Process process = model.getBpmnModel().getProcess(pool.getId());
        model.getBpmnModel().getProcesses().remove(process);
        model.getBpmnModel().getPools().remove(pool);
        IRemoveContext rc = new RemoveContext(pictogramElement);
        IFeatureProvider featureProvider = getFeatureProvider();
        IRemoveFeature removeFeature = featureProvider.getRemoveFeature(rc);
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.