Package org.woped.core.model.petrinet

Examples of org.woped.core.model.petrinet.OperatorTransitionModel


        .getElementById(arc.getTargetId());
    getElementContainer().addReference(arc);

    /* IF transform Operators into classic petrinet */
    if (transformOperators) {
      OperatorTransitionModel operatorModel;
      /* IF THE SOURCE IS AN OPERATOR */
      if (sourceModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE) {

        // storing the source as operator
        operatorModel = (OperatorTransitionModel) sourceModel;
        // put the Target in the SimpleContainer of the operator
        operatorModel.addElement(getElementContainer().getElementById(
            targetModel.getId()));

        LoggerManager
            .debug(Constants.CORE_LOGGER,
                "Connection from Aalst Model detected... resolve Inner-Transitions ...");

        // Register new outgoing connection with the operator.
        // This will generate all the necessary inner arcs
        operatorModel.registerOutgoingConnection(this, targetModel);

        LoggerManager.debug(Constants.CORE_LOGGER,
            "... Inner-Transition resolving completed");
      }
      /* IF OPERATOR IS TARGET */
      else if (targetModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE) {

        LoggerManager
            .debug(Constants.CORE_LOGGER,
                "Connection to Aalst Model detected... resolve Inner-Transitions ...");
        // stor the target as operatorModel
        operatorModel = (OperatorTransitionModel) getElementContainer()
            .getElementById(targetModel.getId());

        // add the source to the SimpleTransContainer
        operatorModel.addElement(getElementContainer().getElementById(
            sourceModel.getId()));

        // Register new incoming connection with the operator.
        // This will generate all the necessary inner arcs
        operatorModel.registerIncomingConnection(this, sourceModel);

        LoggerManager.debug(Constants.CORE_LOGGER,
            "... Inner-Transition resolving completed");

      }
View Full Code Here


          .getElementById(arcToDelete.getSourceId());
      AbstractPetriNetElementModel targetElement = getElementContainer()
          .getElementById(arcToDelete.getTargetId());

      if (sourceElement.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE) {
        OperatorTransitionModel currentOperator = (OperatorTransitionModel) sourceElement;
        // Register the removal of an outgoing arc
        currentOperator.registerOutgoingConnectionRemoval(this,
            targetElement);

        currentOperator.getSimpleTransContainer()
            .removeSourceArcsFromElement(arcToDelete.getTargetId());

        // Each inner transition container contains a local copy of each
        // element connecting to an operator
        // We have to remove this local copy
        currentOperator.getSimpleTransContainer().removeElement(
            targetElement.getId());

      } else if (targetElement.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE) {
        OperatorTransitionModel currentOperator = (OperatorTransitionModel) targetElement;
        // Register the removal of an incoming arc
        currentOperator.registerIncomingConnectionRemoval(this,
            sourceElement);

        currentOperator.getSimpleTransContainer()
            .removeTargetArcsFromElement(arcToDelete.getSourceId());

        // Each inner transition container contains a local copy of each
        // element connecting to an operator
        // We have to remove this local copy
        currentOperator.getSimpleTransContainer().removeElement(
            sourceElement.getId());

        LoggerManager.debug(Constants.CORE_LOGGER,
            "INNER ARC TO SOURCE deleted");
      }
View Full Code Here

              // Their location (screen coordinates) are those of the original operator
              // (and also have to be because the operator screen location is not stored separately
              // but restored from its replacement elements)

                LoggerManager.debug(Constants.FILE_LOGGER, "   ... Setting InnerTtransitions for Operator (ID:" + currentModel.getId() + ")");
                OperatorTransitionModel operatorModel = (OperatorTransitionModel) currentModel;
                Iterator<AbstractPetriNetElementModel> simpleTransIter = operatorModel.getSimpleTransContainer().getElementsByType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE).values().iterator();
                while (simpleTransIter.hasNext())
                {
                    AbstractPetriNetElementModel simpleTransModel = (AbstractPetriNetElementModel) simpleTransIter.next();
                    if (simpleTransModel != null // Sometimes the iterator
                            // returns null...
                            && operatorModel.getSimpleTransContainer().getElementById(simpleTransModel.getId()).getType() == AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE)
                    {
                        initTransition(iNet.addNewTransition(), (TransitionModel) operatorModel.getSimpleTransContainer().getElementById(simpleTransModel.getId()), operatorModel);
                    }

                }
                if (operatorModel.getCenterPlace() != null)
                {
                    PlaceType iCenterPlace = initPlace(iNet.addNewPlace(), operatorModel.getCenterPlace());
                    initToolspecific(iCenterPlace.addNewToolspecific(), operatorModel.getCenterPlace(), operatorModel.getId(), operatorModel.getOperatorType());
                }
                LoggerManager.debug(Constants.FILE_LOGGER, "   ... InnerTtransitions set.");
            }
            for (int i = 0; i < statusBars.length; i++)
                statusBars[i].nextStep();
        }
        /* ##### ARCS ##### */
       
        // When iterating through our arcs, we remember all
        // transitions that are either source or destination of
        // any arc we encounter
        // Instead of serializing the arc itself, we serialize
        // the "inner arcs" of all such transitions
        // To sort out duplicates, we create a set
        Set<AbstractPetriNetElementModel> connectedTransitions = new HashSet<AbstractPetriNetElementModel>()
        Iterator<String> arcIter = elementContainer.getArcMap().keySet().iterator();
        while (arcIter.hasNext())
        {
            ArcModel currentArc = elementContainer.getArcById(arcIter.next());
            AbstractPetriNetElementModel currentTargetModel = (AbstractPetriNetElementModel) elementContainer.getElementById(currentArc.getTargetId());
            AbstractPetriNetElementModel currentSourceModel = (AbstractPetriNetElementModel) elementContainer.getElementById(currentArc.getSourceId());
            // Remember either source or target if it is a transition
            // Please note that one special condition of petri nets is that
            // a transition is never directly connected to another transition
            // so either source or target may be a transition, never both
            if (currentTargetModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
              connectedTransitions.add(currentTargetModel);
            else if (currentSourceModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
              connectedTransitions.add(currentSourceModel);
            else
            {
              // The current arc is not connected to any transition
              // We do not need to take care of any inner arcs
              // and instead store the currentArc itself
                initArc(iNet.addNewArc(), currentArc, null);
            }
            for (int i = 0; i < statusBars.length; i++)
                statusBars[i].nextStep();
        }
      // A transition can be a very complex construct consisting
      // of a lot more than just one primitive petri-net transition (e.g.
      // XOR Split, XOR Join, ...
      // When dumping the PNML structure we must create primitive petri-net
      // objects for applications that cannot read our tool specific
      // complex transitions
      // This is why all transitions store a map of primitive transitions
      // with (ID, Object-Reference) entries.
        // For all transitions connected to at least one arc we will
        // dump the internal arcs now instead of the (previously ignored) visible arcs
        Iterator<AbstractPetriNetElementModel> currentTransition = connectedTransitions.iterator();
        while (currentTransition.hasNext())
        {
          OperatorTransitionModel currentConnectedModel = (OperatorTransitionModel)currentTransition.next();
          Iterator<String> innerArcIter = currentConnectedModel.getSimpleTransContainer().getArcMap().keySet().iterator();
          while (innerArcIter.hasNext())
          {
               // Dump all inner arcs of connected transitions
            ArcModel currentInnerArc = (ArcModel) currentConnectedModel.getSimpleTransContainer().getArcMap().get(innerArcIter.next());
            // Find outer arc corresponding to inner arc
            // (carries graphics information)
            ArcModel currentOuterArc = null;
            if (elementContainer.getElementById(currentInnerArc.getSourceId())!=null)
            {
              currentOuterArc = elementContainer.findArc(currentInnerArc.getSourceId(),
                  currentConnectedModel.getId());
            }
            if (elementContainer.getElementById(currentInnerArc.getTargetId())!=null)
            {
              currentOuterArc = elementContainer.findArc(currentConnectedModel.getId(),
                  currentInnerArc.getTargetId());
            }
           
            // Always try to pass an outer arc with graphics information
            // (contains way points)
View Full Code Here

        {
            return new SubProcessView(cell, editor);
        } else if (cell instanceof OperatorTransitionModel)
        {

            OperatorTransitionModel aTCell = (OperatorTransitionModel) cell;
            if (aTCell.getOperatorType() == OperatorTransitionModel.AND_SPLIT_TYPE)
            {

                return new TransAndSplitView(cell, editor);
            } else if (aTCell.getOperatorType() == OperatorTransitionModel.AND_JOIN_TYPE)
            {

                return new TransAndJoinView(cell, editor);
            } else if (aTCell.getOperatorType() == OperatorTransitionModel.AND_SPLITJOIN_TYPE)
            {
              return new TransAndSplitJoinView(cell, editor);
           
            } else if (aTCell.getOperatorType() == OperatorTransitionModel.XOR_SPLIT_TYPE)
            {

                return new TransXOrSplitView(cell, editor);
            } else if (aTCell.getOperatorType() == OperatorTransitionModel.XOR_JOIN_TYPE)
            {

                return new TransXOrJoinView(cell, editor);

            } else if (aTCell.getOperatorType() == OperatorTransitionModel.OR_SPLIT_TYPE)
            {

                return new TransOrSplitView(cell, editor);

            } else if (aTCell.getOperatorType() == OperatorTransitionModel.XOR_SPLITJOIN_TYPE)
            {

                return new TransXOrSplitJoinView(cell, editor);

            } else if (aTCell.getOperatorType() == OperatorTransitionModel.ANDJOIN_XORSPLIT_TYPE)
            {
                return new TransAndJoinXOrSplitView(cell, editor);

            } else if (aTCell.getOperatorType() == OperatorTransitionModel.XORJOIN_ANDSPLIT_TYPE)
            {
                return new TransXorJoinAndSplitView(cell, editor);

            } else
            {
                LoggerManager.error(Constants.EDITOR_LOGGER, " Not known Aalst ViewType" + cell.getClass().toString());
                // return null;
                return super.createVertexView(cell);
            }
        } else if (cell instanceof TransitionModel)
        {
            return new TransSimpleView(cell, editor);
        } else if (cell instanceof TransitionResourceModel)
        {
            return new TransitionResourceView(cell);
        } else if (cell instanceof TriggerModel)
        {
            TriggerModel aTCell = (TriggerModel) cell;
            /* Hier die �berpr�fung ob Besondere View ? */
            if (aTCell.getTriggertype() == TriggerModel.TRIGGER_MESSAGE)
            {

                return new TriggerExtView(cell);

            } else if (aTCell.getTriggertype() == TriggerModel.TRIGGER_RESOURCE)
            {

                return new TriggerResView(cell);

            } else if (aTCell.getTriggertype() == TriggerModel.TRIGGER_TIME)
            {

                return new TriggerTimeView(cell);

            } else
View Full Code Here

TOP

Related Classes of org.woped.core.model.petrinet.OperatorTransitionModel

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.