Package org.woped.qualanalysis.service

Examples of org.woped.qualanalysis.service.IQualanalysisService


  // ! @param subProcess specifies the sub-process to be opened
  public void openTokenGameSubProcess(SubProcessModel subProcess) {
    EditorVC newEditorWindow = (EditorVC) m_centralMediator
        .createSubprocessEditor(true, this, subProcess);
    newEditorWindow.getModelProcessor().getElementContainer();
    IQualanalysisService qualanService = QualAnalysisServiceFactory
        .createNewQualAnalysisService(newEditorWindow);
    if (qualanService.getSourcePlaces().size() == 1) {
      // Hand an initial token to the sub-process for the token game
      ((PlaceModel) qualanService.getSourcePlaces().iterator().next())
          .receiveToken();
    }
    // Enable token game mode
    newEditorWindow.toggleTokenGame();
  }
View Full Code Here


        // register own MouseHandler
        getGraph().addMouseListener(tokenGameMouseHandler);

        sinkPlaces = new HashSet<PlaceModel>();
        IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(thisEditor);
        Iterator<AbstractPetriNetElementModel> i = qualanService.getSinkPlaces().iterator();
        while (i.hasNext()) {
            sinkPlaces.add((PlaceModel) i.next());
        }

        getGraph().refreshNet();
View Full Code Here

    {
      EditorVC editorVC = (EditorVC) editor;
      if ((editor instanceof SubprocessEditorVC) && !editorVC.isTokenGameEnabled())
      {

        IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
               
        String inputID = ((SubprocessEditorVC)editor).getSubprocessInput().getId();
        String outputID = ((SubprocessEditorVC)editor).getId();

        // Try to get the first source place of the model as well as the
        // first sink place
        // Note that there is a chance neither a source nor a sink actually exist
        // so we need to check whether the iterator is valid!!
        String ainputID = null;
        String aoutputID = null;
        Iterator<AbstractPetriNetElementModel> i = qualanService.getSinkPlaces().iterator();
        if (i.hasNext())
          ainputID = ((AbstractPetriNetElementModel) i.next()).getId();
        i = qualanService.getSourcePlaces().iterator();
        if (i.hasNext())
          aoutputID = ((AbstractPetriNetElementModel) i.next()).getId();
       
        if (qualanService.getNotStronglyConnectedNodes().size() > 0
            || qualanService.getSinkPlaces().size() > 1
            || qualanService.getSourcePlaces().size() > 1
            || inputID.equals(ainputID)
            || outputID.equals(aoutputID))
        {
          String errorMessage = Messages
              .getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Start");

          if (qualanService.getNotStronglyConnectedNodes().size() > 0)
          {
            errorMessage += Messages
                .getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.StronglyConnected");
          }
          if (qualanService.getSourcePlaces().size() > 1)
          {
            errorMessage += Messages
                .getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Source");
          } else
          {
            if (inputID.equals(ainputID))
            {
              errorMessage += Messages
              .getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Input");
            }
          }

          if (qualanService.getSinkPlaces().size() > 1)
          {
            errorMessage += Messages
                .getString("Action.CloseSubProcessEditor.StructuralAnalysisResult.Message.Sink");
          } else
          {
View Full Code Here

    return cutVert;
  }
 
  @SuppressWarnings("unused")
  private double calculateTP(){
    IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
    return qualanService.getTPHandles().size();
  }
View Full Code Here

    return qualanService.getTPHandles().size();
  }
 
  @SuppressWarnings("unused")
  private double calculatePT(){
    IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
    return qualanService.getPTHandles().size();
  }
View Full Code Here

     * @param editor
     */

    private boolean isSound(IEditor editor) {

        IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);

        if (qualanService.isSound()) {
            return true;
        } else {
            JOptionPane.showMessageDialog(null, Messages.getString("QuantAna.Message.SoundnessViolation"));
            return false;
        }
View Full Code Here

        ModelElementContainer mec = editor.getModelProcessor().getElementContainer();
        boolean branchingOk = true;
        String[] param = { "", "", "" };
        Iterator<AbstractPetriNetElementModel> transes = (mec.getElementsByType(AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)).values()
                .iterator();
        IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
        Iterator<AbstractPetriNetElementModel> places = qualanService.getPlaces().iterator();
        AbstractPetriNetElementModel end = (AbstractPetriNetElementModel) qualanService.getSinkPlaces().iterator().next();

        while (transes.hasNext()) {
            AbstractPetriNetElementModel trans = (AbstractPetriNetElementModel) transes.next();
            Map<String, Object> outArcs = mec.getOutgoingArcs(trans.getId());
            int sum = 0;
View Full Code Here

                                    }
                                    // BPEL-Export
                                    else
                                        if (editor.getDefaultFileType() == FileFilterImpl.BPELFilter
                                                && this.isSound(editor)) {
                                          IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
                                            int wellStruct = qualanService.getPTHandles().size() + qualanService.getTPHandles().size();
                                            int freeChoice = qualanService.getFreeChoiceViolations().size();
                                            int sound = wellStruct + freeChoice;
                                            if (sound == 0) {
                                                succeed = BPEL.getBPELMainClass().saveFile(editor.getFilePath(), editor);
                                                ConfigurationManager.getConfiguration().setCurrentWorkingdir(editor.getPathName());
                                            } else {
View Full Code Here

  Node sinkPlace = null;
  LinkedList<Node> path = new LinkedList<Node>();
  ModelElementContainer mec = null;
 
  public WorkflowNetGraph(IEditor editor){
    IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);
    this.mec = editor.getModelProcessor().getElementContainer();
    zyklen = "";
   
    int numNodes = mec.getRootElements().size();
   
    nodeArray = new Node[numNodes];
    int nextIdx = 0;
   
    AbstractPetriNetElementModel source = (AbstractPetriNetElementModel)qualanService.getSourcePlaces().iterator().next();
    sourcePlace = new Node(source.getId(), source.getNameValue());
    sourcePlace.setType(Node.TYPE_PLACE);
   
    AbstractPetriNetElementModel sink = (AbstractPetriNetElementModel)qualanService.getSinkPlaces().iterator().next();
    sinkPlace = new Node(sink.getId(), sink.getNameValue());
    sinkPlace.setType(Node.TYPE_PLACE);
   
    initNodeArray();
   
View Full Code Here

   * @param sa
   * @param res
   */
  public SimGraph(IEditor editor) {
    this.mec = editor.getModelProcessor().getElementContainer();
    IQualanalysisService qualanService = QualAnalysisServiceFactory.createNewQualAnalysisService(editor);   
    buildGraph();   
    AbstractPetriNetElementModel el = (AbstractPetriNetElementModel) qualanService.getSinkPlaces().iterator().next();
    sink = Nodes.get(el.getId());
    el = (AbstractPetriNetElementModel) qualanService.getSourcePlaces().iterator().next();
    source = Nodes.get(el.getId());       
  }
View Full Code Here

TOP

Related Classes of org.woped.qualanalysis.service.IQualanalysisService

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.