Package org.enhydra.shark.xpdl.elements

Examples of org.enhydra.shark.xpdl.elements.Application


         return assId;
      }

      protected void invokeApplication(Tool tool) throws Throwable {
         String applicationId = tool.getId();
         Application app=SharkUtilities.getApplication(tool, applicationId);

          ArrayList parameters = new ArrayList();

         // the extended attributes are always the first parameter passed to tool agent
         String appPStr=app.getExtendedAttributes().getExtendedAttributesString();
          AppParameter param=new AppParameter("ExtendedAttributes","ExtendedAttributes",XPDLConstants.FORMAL_PARAMETER_MODE_IN,appPStr,String.class);
         parameters.add(param);

         ActualParameters aps=tool.getActualParameters();
         FormalParameters fps=app.getApplicationTypes().getFormalParameters();
         Map m=createContextMap(aps,fps);
         Iterator itFps=fps.toElements().iterator();
         Iterator itAps=aps.toElements().iterator();
         while (itFps.hasNext() && itAps.hasNext()) {
            FormalParameter fp=(FormalParameter)itFps.next();
            ActualParameter ap=(ActualParameter)itAps.next();
            String fpMode=fp.getMode();
            String fpId=fp.getId();
            Object paramVal=m.get(fpId);

            param=new AppParameter(ap.toValue(),fpId,fpMode,paramVal,SharkUtilities.getJavaClass(fp));
            parameters.add(param);
         }
         ApplicationMappingManager mm=SharkEngineManager.getInstance().getApplicationMapPersistenceManager();
         ApplicationMap tad=null;
         if (mm!=null) {
            XMLComplexElement cOwn=(XMLComplexElement)app.getParent().getParent();
            boolean isProcessApp=(cOwn instanceof WorkflowProcess);
            ApplicationMappingTransaction t=null;
            try {
               t = SharkUtilities.createApplicationMappingTransaction();
               tad= mm.getApplicationMap(
View Full Code Here


         return assId;
      }

      protected void invokeApplication(Tool tool) throws Throwable {
         String applicationId = tool.getId();
         Application app=SharkUtilities.getApplication(tool, applicationId);

          ArrayList parameters = new ArrayList();

         // the extended attributes are always the first parameter passed to tool agent
         String appPStr=app.getExtendedAttributes().getExtendedAttributesString();
          AppParameter param=new AppParameter("ExtendedAttributes","ExtendedAttributes",XPDLConstants.FORMAL_PARAMETER_MODE_IN,appPStr,String.class);
         parameters.add(param);

         ActualParameters aps=tool.getActualParameters();
         FormalParameters fps=app.getApplicationTypes().getFormalParameters();
         Map m=createContextMap(aps,fps);
         Iterator itFps=fps.toElements().iterator();
         Iterator itAps=aps.toElements().iterator();
         while (itFps.hasNext() && itAps.hasNext()) {
            FormalParameter fp=(FormalParameter)itFps.next();
            ActualParameter ap=(ActualParameter)itAps.next();
            String fpMode=fp.getMode();
            String fpId=fp.getId();
            Object paramVal=m.get(fpId);

            param=new AppParameter(ap.toValue(),fpId,fpMode,paramVal,SharkUtilities.getJavaClass(fp));
            parameters.add(param);
         }
         ApplicationMappingManager mm=SharkEngineManager.getInstance().getApplicationMapPersistenceManager();
         ApplicationMap tad=null;
         if (mm!=null) {
            XMLComplexElement cOwn=(XMLComplexElement)app.getParent().getParent();
            boolean isProcessApp=(cOwn instanceof WorkflowProcess);
            ApplicationMappingTransaction t=null;
            try {
               t = SharkUtilities.createApplicationMappingTransaction();
               tad= mm.getApplicationMap(
View Full Code Here

         return assId;
      }

      protected void invokeApplication(Tool tool) throws Throwable {
         String applicationId = tool.getId();
         Application app=SharkUtilities.getApplication(tool, applicationId);

          ArrayList parameters = new ArrayList();

         // the extended attributes are always the first parameter passed to tool agent
         String appPStr=app.getExtendedAttributes().getExtendedAttributesString();
          AppParameter param=new AppParameter("ExtendedAttributes","ExtendedAttributes",XPDLConstants.FORMAL_PARAMETER_MODE_IN,appPStr,String.class);
         parameters.add(param);

         ActualParameters aps=tool.getActualParameters();
         FormalParameters fps=app.getApplicationTypes().getFormalParameters();
         Map m=createContextMap(aps,fps);
         Iterator itFps=fps.toElements().iterator();
         Iterator itAps=aps.toElements().iterator();
         while (itFps.hasNext() && itAps.hasNext()) {
            FormalParameter fp=(FormalParameter)itFps.next();
            ActualParameter ap=(ActualParameter)itAps.next();
            String fpMode=fp.getMode();
            String fpId=fp.getId();
            Object paramVal=m.get(fpId);

            param=new AppParameter(ap.toValue(),fpId,fpMode,paramVal,SharkUtilities.getJavaClass(fp));
            parameters.add(param);
         }
         ApplicationMappingManager mm=SharkEngineManager.getInstance().getApplicationMapPersistenceManager();
         ApplicationMap tad=null;
         if (mm!=null) {
            XMLComplexElement cOwn=(XMLComplexElement)app.getParent().getParent();
            boolean isProcessApp=(cOwn instanceof WorkflowProcess);
            ApplicationMappingTransaction t=null;
            try {
               t = SharkUtilities.createApplicationMappingTransaction();
               tad= mm.getApplicationMap(
View Full Code Here

            while (el.getParent() != null) {
                el = el.getParent();
            }
            Package pkg = (Package) el;
            Applications apps = pkg.getApplications();
            Application defaultApp = apps.getApplication(defaultAppId);
            if (defaultApp == null) {
                // create default app
                defaultApp = createXPDLObject(apps, null, true);
                defaultApp.setId(defaultAppId);
            }

            // create tool mapping
            Tools tools = act.getActivityTypes().getImplementation().getImplementationTypes().getTools();
            Tool tool = createXPDLObject(tools, null, true);
View Full Code Here

    }

    public Application createXPDLObject(Applications apps,
            String type,
            boolean addToCollection) {
        Application app = (Application) apps.generateNewElement();
        adjustType(app, type);

        JaWETypes jts = JaWEManager.getInstance().getJaWEController().getJaWETypes();
        boolean hasTemplate = jts.hasTemplateId(type);
        if (hasTemplate) {
            jts.fillFromTemplate(app, type);
        }
        String id = app.getId();
        if (!hasTemplate || id.equals("") || apps.getApplication(id) != null) {
            if (id.equals("")) {
                id = JaWEManager.getInstance().getIdFactory().generateUniqueId(apps);
            } else {
                id = JaWEManager.getInstance().getIdFactory().generateSimilarOrIdenticalUniqueId(apps, new HashSet(), id);
            }
            int i = 0;
            while (apps.getApplication(id) != null) {
                id = id + String.valueOf(++i);
            }
            app.setId(id);
        }

        adjustXPDLObject(app, type);

        if (addToCollection) {
View Full Code Here

        validateStandard(el, existingErrors, fullCheck);
        if(existingErrors.size() == 0 || fullCheck)
        {
            String toolId = el.getId();
            WorkflowProcess wp = XMLUtil.getWorkflowProcess(el);
            Application app = XMLUtil.findApplication(xmlInterface, wp, toolId);
            if(app != null)
            {
                XMLElement ch = app.getApplicationTypes().getChoosen();
                if(ch instanceof FormalParameters)
                {
                    ActualParameters aps = el.getActualParameters();
                    checkParameterMatching((FormalParameters)ch, aps, existingErrors, properties.getProperty("ValidateActualParameterExpressions", "false").equals("true"), fullCheck);
                }
View Full Code Here

    protected boolean checkToolId(XMLAttribute tlId, List existingErrors, boolean fullCheck)
    {
        XMLValidationError verr = null;
        String toolId = tlId.toValue();
        WorkflowProcess wp = XMLUtil.getWorkflowProcess(tlId);
        Application app = XMLUtil.findApplication(xmlInterface, wp, toolId);
        if(app == null)
        {
            verr = new XMLValidationError("ERROR", "LOGIC", "ERROR_NON_EXISTING_APPLICATION_REFERENCE", toolId, tlId);
            existingErrors.add(verr);
        }
View Full Code Here

TOP

Related Classes of org.enhydra.shark.xpdl.elements.Application

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.