Package org.woped.core.model

Examples of org.woped.core.model.CreationMap


        return simpleTransContainer;
    }

    public CreationMap getCreationMap()
    {
        CreationMap map = super.getCreationMap();
        if (map != null)
        {
            map.setOperatorType(getOperatorType());
        }
        return map;
    }
View Full Code Here


     * @return
     */
    private PlaceModel addNewCenterPlace()
    {
        PlaceModel centerPlace;
        CreationMap map = CreationMap.createMap();
        map.setId(OPERATOR_SEPERATOR_PLACE + getId());
        map.setName(getNameValue());
        map.setType(AbstractPetriNetElementModel.PLACE_TYPE);
        map.setPosition(getPosition());
        centerPlace = (PlaceModel) ModelElementFactory.createModelElement(map);
        getSimpleTransContainer().addElement(centerPlace);
        return centerPlace;
    }
View Full Code Here

  }

  private void importPlaces(PlaceType[] places,
      ModelElementContainer currentContainer) throws Exception {
    int tokens;
    CreationMap map;
    boolean doNOTcreate = false;
    for (int i = 0; i < places.length; i++) {
      map = CreationMap.createMap();
      map.setEditOnCreation(false);
      map.setType(AbstractPetriNetElementModel.PLACE_TYPE);
      try {
        importNameAndLayout(places[i], map);
         
        try {
          if (places[i].isSetInitialMarking()) {
            // Remove all flavors of whitespace before converting to an integer
            String initialMarkingString = places[i]
                .getInitialMarking().getText().replaceAll("\\s", "");
            if ((tokens = Integer.parseInt(initialMarkingString)) > 0) {
              map.setTokens(tokens);
            }
          }
          // toolspecific
          if (ConfigurationManager.getConfiguration()
              .isImportToolspecific()) {
            for (int j = 0; j < places[i].getToolspecificArray().length; j++) {
              if (places[i].getToolspecificArray(j).getTool()
                  .equals("WoPeD")) {
                switch (places[i].getToolspecificArray(j)
                    .getOperator().getType()) {
                case OperatorTransitionModel.XOR_SPLITJOIN_TYPE:
                case OperatorTransitionModel.ANDJOIN_XORSPLIT_TYPE:
                case OperatorTransitionModel.XORJOIN_ANDSPLIT_TYPE:
                  doNOTcreate = true;
                  break;
                default:
                }
                ;
              } else {
                map.addUnknownToolSpec(places[i]
                    .getToolspecificArray(j));
              }
            }
          }
        } catch (Exception e) {
View Full Code Here

    // for transitions so we use it at this point to do so
    PetriNetModelProcessor processor = new PetriNetModelProcessor();
    processor.setElementContainer(currentContainer);

    TransitionType transitions[] = currentNet.getTransitionArray();
    CreationMap map;

    for (int i = 0; i < transitions.length; i++) {
      map = CreationMap.createMap();
      map.setEditOnCreation(false);
      map.setType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE);
      try {
        importNameAndLayout(transitions[i], map);
        try {
          if (ConfigurationManager.getConfiguration()
              .isImportToolspecific()) {
            for (int j = 0; j < transitions[i]
                .getToolspecificArray().length; j++) {
              if (transitions[i].getToolspecificArray(j)
                  .getTool().equals("WoPeD")) {
                if (transitions[i].getToolspecificArray(j)
                    .isSetTime()) {
                  map.setTransitionTime(transitions[i]
                      .getToolspecificArray(j).getTime());
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetTimeUnit()) {
                  map.setTransitionTimeUnit(transitions[i]
                      .getToolspecificArray(j)
                      .getTimeUnit());
                }
               
                //set operatorOrientation
                if (transitions[i].getToolspecificArray(j)
                    .isSetOrientation()) {
                  map.setOperatorPosition(transitions[i]
                      .getToolspecificArray(j)
                      .getOrientation());
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetOperator()) {
                  map.setOperatorType(transitions[i]
                      .getToolspecificArray(j)
                      .getOperator().getType());
                  map
                      .setType(TransitionModel.TRANS_OPERATOR_TYPE);
                  map.setId(transitions[i]
                      .getToolspecificArray(j)
                      .getOperator().getId());
                } else if (transitions[i].getToolspecificArray(
                    j).isSetSubprocess()) {
                  map.setType(AbstractPetriNetElementModel.SUBP_TYPE);
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetTrigger()) {
                  map.setTriggerType(transitions[i]
                      .getToolspecificArray(j)
                      .getTrigger().getType());
                  map.setTriggerPosition(transitions[i]
                      .getToolspecificArray(j)
                      .getTrigger().getGraphics()
                      .getPosition().getX().intValue(),
                      transitions[i]
                          .getToolspecificArray(j)
                          .getTrigger().getGraphics()
                          .getPosition().getY()
                          .intValue());
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetTransitionResource()) {
                  // &&
                  // transitions[i].getToolspecificArray(j).getTrigger().getType()
                  // == 200
                  map.setResourceOrgUnit(transitions[i]
                      .getToolspecificArray(j)
                      .getTransitionResource()
                      .getOrganizationalUnitName());
                  map.setResourceRole(transitions[i]
                      .getToolspecificArray(j)
                      .getTransitionResource()
                      .getRoleName());
                  map.setResourcePosition(transitions[i]
                      .getToolspecificArray(j)
                      .getTransitionResource()
                      .getGraphics().getPosition().getX()
                      .intValue(), transitions[i]
                      .getToolspecificArray(j)
                      .getTransitionResource()
                      .getGraphics().getPosition().getY()
                      .intValue());
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetEmpty()) {
                  TEmpty empty = transitions[i]
                      .getToolspecificArray(j).getEmpty();
                  Empty bpel = new Empty(empty.getName());
                  map.setBpeldata(bpel);
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetAssign()) {
                  TAssign assign = transitions[i]
                      .getToolspecificArray(j)
                      .getAssign();
                  Assign bpel = new Assign(assign.getName(),
                      assign.getCopyArray(0).getFrom()
                          .getVariable(), assign
                          .getCopyArray(0).getTo()
                          .getVariable());
                  map.setBpeldata(bpel);
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetInvoke()) {
                  TInvoke invoke = transitions[i]
                      .getToolspecificArray(j)
                      .getInvoke();
                  Invoke bpel = new Invoke(invoke.getName(),
                      invoke.getPartnerLink(), invoke
                          .getOperation(), "", invoke
                          .getInputVariable(), invoke
                          .getOutputVariable());
                  map.setBpeldata(bpel);
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetReceive()) {
                  TReceive receive = transitions[i]
                      .getToolspecificArray(j)
                      .getReceive();
                  Receive bpel = new Receive(receive
                      .getName(), receive
                      .getPartnerLink(), receive
                      .getOperation(), receive
                      .getVariable());
                  map.setBpeldata(bpel);
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetReply()) {
                  TReply reply = transitions[i]
                      .getToolspecificArray(j).getReply();
                  Reply bpel = new Reply(reply.getName(),
                      reply.getPartnerLink(), reply
                          .getOperation(), reply
                          .getVariable());
                  map.setBpeldata(bpel);
                }
                if (transitions[i].getToolspecificArray(j)
                    .isSetWait()) {
                  TWait wait = transitions[i]
                      .getToolspecificArray(j).getWait();
                  Wait bpel = new Wait(wait.getName(), wait
                      .getTyp(), wait.getYear(), wait
                      .getMonth(), wait.getDay(), wait
                      .getHour(), wait.getMinute(), wait
                      .getSecond());
                  map.setBpeldata(bpel);
                }
              } else {

                map.addUnknownToolSpec(transitions[i]
                    .getToolspecificArray(j));
              }
            }
          }
        } catch (Exception e) {
          warnings
              .add("- TRANSITION LOST INFORMATION ("
                  + transitions[i].getId()
                  + "): Exception while importing lesser important information.");
        }

        if (!currentContainer.containsElement(map.getId())) {
          // There is one fun thing about transitions:
          // They may be inner transitions which are treated specially
          // by carrying
          // some tool-specific information as to which operator they
          // belong.
          // Now, instead of the transition, an operator is created
          // for each of those inner transitions
          // and all but the first such instance are discarded here
          // because an element
          // with the same id already exists at this point
          AbstractPetriNetElementModel element = processor.createElement(map);
          currentContainer.addElement(element);
          LoggerManager.debug(Constants.FILE_LOGGER,
              " ... Transition (ID:" + map.getId() + ")imported");
          // increaseCurrent();

          if (element.getType() == AbstractPetriNetElementModel.SUBP_TYPE) {
            // The element we just created is a sub-process element
            // Get the corresponding page from the PNML document
View Full Code Here

                + ")";
          } else {
            currTransitionName = "(" + arcSource + ") -> "
                + arcTarget;
          }
          CreationMap map = CreationMap.createMap();
          map.setId(currTransitionID);
          currTransition = new TransitionModel(map);
          currTransition.setNameValue(currTransitionName);
          LoggerManager.debug(Constants.FILE_LOGGER,
              " ... Simulation: HelperTransition for arc ("
                  + currTransitionID + ") created");
View Full Code Here

TOP

Related Classes of org.woped.core.model.CreationMap

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.