Package org.activiti.designer.util.editor

Examples of org.activiti.designer.util.editor.Bpmn2MemoryModel


    return clazz.cast(getBusinessObject(pe));
  }

  protected Object getBusinessObject(PictogramElement element) {
    Diagram diagram = getContainer(element);
    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(diagram));

    if(model != null) {
      return model.getFeatureProvider().getBusinessObjectForPictogramElement(element);
    }
    return null;
  }
View Full Code Here


    return null;
  }

  protected IFeatureProvider getFeatureProvider(PictogramElement element) {
    Diagram diagram = getContainer(element);
    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(diagram));

    if(model != null) {
      return model.getFeatureProvider();
    }
    return null;
  }
View Full Code Here

      }
    }
  }

  public static final String getNextId(final Class<? extends BaseElement> featureClass, final String featureIdKey, final Diagram diagram) {
    Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(diagram));
    int determinedId = 0;
   
    if (featureClass.equals(Pool.class)) {
      determinedId = loopThroughPools(featureClass, determinedId, model.getBpmnModel().getPools(), featureIdKey);
    } else {
   
      for (Process process : model.getBpmnModel().getProcesses()) {
         
        if (featureClass.equals(Lane.class)) {
          determinedId = loopThroughLanes(featureClass, determinedId, process.getLanes(), featureIdKey);
        } else if (featureClass.equals(TextAnnotation.class) || featureClass.equals(Association.class)) {
          determinedId = loopThroughArtifacts(featureClass, determinedId, process.getArtifacts(), featureIdKey);
View Full Code Here

      Object bo = getBusinessObject(pe);
      // the filter assured, that it is a EClass
      if (bo == null)
        return;
     
      final Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      if (model == null) {
        return;
      }
     
      String messageRef = null;
      StartEvent startEvent = (StartEvent) bo;
      if(startEvent.getEventDefinitions().get(0) != null) {
        MessageEventDefinition messageDefinition = (MessageEventDefinition) startEvent.getEventDefinitions().get(0);
        if(StringUtils.isNotEmpty(messageDefinition.getMessageRef())) {
          messageRef = messageDefinition.getMessageRef();
         
        }
      }
     
      String[] items = new String[model.getBpmnModel().getMessages().size() + 1];
      items[0] = "";
      int counter = 1;
      int selectedCounter = 0;
      for (Message message : model.getBpmnModel().getMessages()) {
        items[counter] = message.getId() + " / " + message.getName();
        if(message.getId().equals(messageRef)) {
          selectedCounter = counter;
        }
        counter++;
View Full Code Here

    if (pe != null) {
      Object bo = getBusinessObject(pe);
      if (bo == null)
        return;

      final Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      if (model == null) {
        return;
      }

      boolean cancelActivity = ((BoundaryEvent) bo).isCancelActivity();
      if (cancelActivity == false) {
        cancelActivityCombo.select(1);
      } else {
        cancelActivityCombo.select(0);
      }

      String messageRef = null;
      if (bo instanceof BoundaryEvent) {
        BoundaryEvent boundaryEvent = (BoundaryEvent) bo;
        if (boundaryEvent.getEventDefinitions().get(0) != null) {
          MessageEventDefinition messageDefinition = (MessageEventDefinition) boundaryEvent.getEventDefinitions().get(0);
          if (StringUtils.isNotEmpty(messageDefinition.getMessageRef())) {
            messageRef = messageDefinition.getMessageRef();
          }
        }
      }

      String[] items = new String[model.getBpmnModel().getMessages().size() + 1];
      items[0] = "";
      int counter = 1;
      int selectedCounter = 0;
      for (Message message : model.getBpmnModel().getMessages()) {
        items[counter] = message.getId() + " / " + message.getName();
        if (message.getId().equals(messageRef)) {
          selectedCounter = counter;
        }
        counter++;
View Full Code Here

public class ActivitiPropertyFilter extends AbstractPropertySectionFilter {

  protected Object getBusinessObject(PictogramElement element) {
    if (element == null) return null;
    Diagram diagram = getContainer(element);
    Bpmn2MemoryModel model = (ModelHandler.getModel(EcoreUtil.getURI(diagram)));
    if(model != null) {
      return model.getFeatureProvider().getBusinessObjectForPictogramElement(element);
    }
    return null;
  }
View Full Code Here

      final Lane lane = (Lane) parentObject;
      lane.getFlowReferences().add(newUserTask.getId());
      lane.getParentProcess().addFlowElement(newUserTask);
     
    } else {
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      if (model.getBpmnModel().getMainProcess() == null) {
        model.addMainProcess();
      }
      model.getBpmnModel().getMainProcess().addFlowElement(newUserTask);
    }

    addGraphicalContent(context, newUserTask);

    // activate direct editing after object creation
View Full Code Here

      final Lane lane = (Lane) parentObject;
      lane.getFlowReferences().add(startEvent.getId());
      lane.getParentProcess().addFlowElement(startEvent);
     
    } else {
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      if (model.getBpmnModel().getMainProcess() == null) {
        model.addMainProcess();
      }
      model.getBpmnModel().getMainProcess().addFlowElement(startEvent);
    }

    addGraphicalRepresentation(context, startEvent);

    // return newly created business object(s)
View Full Code Here

      final Lane lane = (Lane) parentObject;
      lane.getFlowReferences().add(newMailTask.getId());
      lane.getParentProcess().addFlowElement(newMailTask);
     
    } else {
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      if (model.getBpmnModel().getMainProcess() == null) {
        model.addMainProcess();
      }
      model.getBpmnModel().getMainProcess().addFlowElement(newMailTask);
    }

    addGraphicalContent(context, newMailTask);

    // activate direct editing after object creation
View Full Code Here

      final Lane lane = (Lane) parentObject;
      lane.getFlowReferences().add(newScriptTask.getId());
      lane.getParentProcess().addFlowElement(newScriptTask);
     
    } else {
      Bpmn2MemoryModel model = ModelHandler.getModel(EcoreUtil.getURI(getDiagram()));
      if (model.getBpmnModel().getMainProcess() == null) {
        model.addMainProcess();
      }
      model.getBpmnModel().getMainProcess().addFlowElement(newScriptTask);
    }

    addGraphicalContent(context, newScriptTask);

    // activate direct editing after object creation
View Full Code Here

TOP

Related Classes of org.activiti.designer.util.editor.Bpmn2MemoryModel

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.