Examples of NetToolspecificType


Examples of org.woped.pnml.NetToolspecificType

        {
            iNet.addNewName().setText(petrinetModel.getName());
        }
        if (ConfigurationManager.getConfiguration().isExportToolspecific())
        {
            NetToolspecificType iNetToolSpec = iNet.addNewToolspecific();

            iNetToolSpec.setTool("WoPeD");
            iNetToolSpec.setVersion("1.0"); //TODO Version aus properties �bernehmen!?
           
            //get PartnerLinks
            TPartnerLinks iPLs = iNetToolSpec.addNewPartnerLinks();
            Iterator<Partnerlink> plist = petrinetModel.getElementContainer().getPartnerlinkList().getPartnerlinkList().iterator();
            while (plist.hasNext()){
              Partnerlink link = plist.next();
              org.woped.pnml.TPartnerLink iPL = iPLs.addNewPartnerLink();
              iPL.setName(link.getName());
              iPL.setPartnerLinkType(link.getPartnerlinkTypeByQName());
              iPL.setPartnerRole(link.getPartnerlinkRole());
              iPL.setMyRole(link.getMyRole());
              iPL.setWSDL(link.getWsdlUrl());
            }
           
            //get Variables
            TVariables iVs = iNetToolSpec.addNewVariables();
            int VarCounter=0;
            while (petrinetModel.getElementContainer().getVariableList().getBpelCode().sizeOfVariableArray()>VarCounter){
              org.woped.pnml.TVariable iVar = iVs.addNewVariable();
              iVar.setName(petrinetModel.getElementContainer().getTVariablesList().getVariableArray(VarCounter).getName());
              iVar.setType(petrinetModel.getElementContainer().getTVariablesList().getVariableArray(VarCounter).getType());
              VarCounter++;
             }
           
            // scale
            iNetToolSpec.setScale((int)(editor.getGraph().getScale() * 100));
           
            // graphics
            GraphicsSimpleType iGraphicsNet = iNetToolSpec.addNewBounds();
            EditorLayoutInfo layoutInfo = editor.getEditorPanel().getSavedLayoutInfo();
            if (layoutInfo.getSavedSize() != null)
            {
                DimensionType dim = iGraphicsNet.addNewDimension();
                dim.setX(new BigDecimal(layoutInfo.getSavedSize().getWidth()));
                dim.setY(new BigDecimal(layoutInfo.getSavedSize().getHeight()));
            }
            if (layoutInfo.getSavedLocation() != null)
            {
              PositionType location = iGraphicsNet.addNewPosition();
                location.setX(new BigDecimal(layoutInfo.getSavedLocation().getX()));
                location.setY(new BigDecimal(layoutInfo.getSavedLocation().getY()));
            }
            // Store the width of the tree view and the height of the overview
            if(layoutInfo.getTreeViewWidthRight()!=0){
              iNetToolSpec.setTreeWidthRight(layoutInfo.getTreeViewWidthRight());
            }else{
              iNetToolSpec.setTreeWidthRight(layoutInfo.getTreeViewWidth());
            }
            iNetToolSpec.setOverviewPanelVisible(layoutInfo.getOverviewPanelVisible());
            iNetToolSpec.setTreeHeightOverview(layoutInfo.getTreeHeightOverview());
            iNetToolSpec.setTreePanelVisible(layoutInfo.getTreePanelVisible());
            //verticalLayout
            iNetToolSpec.setVerticalLayout(editor.isRotateSelected());
            // resources
            ResourcesType iNetResources = iNetToolSpec.addNewResources();
            // Rescources
            ResourceType iResourceType;
            ResourceModel rModelTemp;

            for (Iterator<ResourceModel> iter = petrinetModel.getResources().iterator(); iter.hasNext();)
            {
                rModelTemp = (ResourceModel) iter.next();
                iResourceType = iNetResources.addNewResource();
                iResourceType.setName(rModelTemp.getName());
                for (int i = 0; i < statusBars.length; i++)
                    statusBars[i].nextStep();
            }
            // Roles

            RoleType iRoleType;
            ResourceClassModel roleModelTemp;
            for (Iterator<ResourceClassModel> iter = petrinetModel.getRoles().iterator(); iter.hasNext();)
            {
                roleModelTemp = (ResourceClassModel) iter.next();
                iRoleType = iNetResources.addNewRole();
                iRoleType.setName(roleModelTemp.getName());
                if(roleModelTemp.getSuperModels()!= null){
                  for (Iterator<ResourceClassModel> i = roleModelTemp.getSuperModels();i.hasNext();)
                  {               
                    ResourceClassModel superMe = i.next();
                    SuperModelType newSuper =iRoleType.addNewSuperModel();
                    newSuper.setName(superMe.getName());
                  }
                }
                for (int i = 0; i < statusBars.length; i++)
                    statusBars[i].nextStep();
            }
            // Orga Units
            OrganizationUnitType iOrganizationUnitType;
            ResourceClassModel orgunitModelTemp;
            for (Iterator<ResourceClassModel> iter = petrinetModel.getOrganizationUnits().iterator(); iter.hasNext();)
            {
                orgunitModelTemp = (ResourceClassModel) iter.next();
                iOrganizationUnitType = iNetResources.addNewOrganizationUnit();
                iOrganizationUnitType.setName(orgunitModelTemp.getName());
                if(orgunitModelTemp.getSuperModels()!=null){
                  for (Iterator<ResourceClassModel> i = orgunitModelTemp.getSuperModels();i.hasNext();)
                  {
                    ResourceClassModel superMe = i.next();
                    SuperModelType newSuper= iOrganizationUnitType.addNewSuperModel();
                    newSuper.setName(superMe.getName());
                  }
                }
                for (int i = 0; i < statusBars.length; i++)
                    statusBars[i].nextStep();
            }
            // ResourceMap
            ResourceMappingType iNetResourceMap;           
            for (Iterator<String> iter = petrinetModel.getResourceMapping().keySet().iterator();iter.hasNext();)
            {
                String tempResourceClass = (String) iter.next();
                Vector<String> values = petrinetModel.getResourceMapping().get(tempResourceClass);
                // TODO check if mapping exists NullPointerExeption bei
                // speicherung ge�nderter orgUnit die keine zugeordnete Resource
                // hat!
                for (Iterator<String> iterator = values.iterator(); iterator.hasNext();)
                {
                    iNetResourceMap = iNetResources.addNewResourceMapping();
                    iNetResourceMap.setResourceClass(tempResourceClass);
                    iNetResourceMap.setResourceID(iterator.next().toString());
                }
                for (int i = 0; i < statusBars.length; i++)
                    statusBars[i].nextStep();
            }
           
            // Simulations
            SimulationsType iNetSimulations = iNetToolSpec.addNewSimulations();
            SimulationType iSimulation;
            TransitionsequenceType iTransitionsequence;
            OccuredtransitionType iOccuredTransition;
            for (Iterator<SimulationModel> iter = petrinetModel.getSimulations().iterator();iter.hasNext();)
            {
View Full Code Here

Examples of org.woped.pnml.NetToolspecificType

                if (subProcessLayout!=null)
                {
                  // This sub-process model stores some information about
                  // the layout of the subprocessor editor
                  // Convert it to XMLBeans information and store it
                  NetToolspecificType subPToolSpec = newNet.addNewToolspecific();
                 
                  subPToolSpec.setTool("WoPeD");
                  subPToolSpec.setVersion("1.0");
                  // graphics
                  GraphicsSimpleType iGraphicsNet = subPToolSpec.addNewBounds();
                  if (subProcessLayout.getSavedSize() != null)
                  {
                    DimensionType dim = iGraphicsNet.addNewDimension();
                    dim.setX(new BigDecimal(subProcessLayout.getSavedSize().getWidth()));
                    dim.setY(new BigDecimal(subProcessLayout.getSavedSize().getHeight()));
                  }
                  if (subProcessLayout.getSavedLocation() != null)
                  {
                    PositionType location = iGraphicsNet.addNewPosition();
                    location.setX(new BigDecimal(subProcessLayout.getSavedLocation().getX()));
                    location.setY(new BigDecimal(subProcessLayout.getSavedLocation().getY()));
                  }
                  // Store the width of the tree view
                  subPToolSpec.setTreeWidthRight(subProcessLayout.getTreeViewWidthRight());
                  subPToolSpec.setOverviewPanelVisible(subProcessLayout.getOverviewPanelVisible());
                  subPToolSpec.setTreeHeightOverview(subProcessLayout.getTreeHeightOverview());
                  subPToolSpec.setTreePanelVisible(subProcessLayout.getTreePanelVisible());
                }
               
                // Call ourselves recursively to store the sub-process net
                saveModelElementContainer(newNet, subProcessContainer);
            } else if (currentModel.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.