Package nexj.core.meta.workflow

Examples of nexj.core.meta.workflow.Workflow


         sWorkflowName = sWorkflowName.substring(0, i);
      }

      XMLMetadataHelper.validateName(sWorkflowName);

      final Workflow workflow = new Workflow(sWorkflowName);

      workflow.setResourceName(m_helper.getCurResourceName());
      workflow.setVersion(nVersion);
      workflow.setMetaclass(m_metadata.getMetaclass(XMLUtil.getReqStringAttr(workflowElement, "class")));

      workflow.setAttributes((Pair)m_helper.parse(
         XMLUtil.getStringAttr(workflowElement, "attributes"),
         true, null, null, m_metadata.getGlobalEnvironment()));

      workflow.setPrivileged(XMLUtil.getBooleanAttr(workflowElement, "privileged", workflow.isPrivileged()));
      workflow.setCaption(XMLUtil.getStringAttr(workflowElement, "caption"));

      String sVarList = XMLUtil.getStringAttr(workflowElement, "variables");

      if (sVarList != null)
      {
         for (StringTokenizer tokenizer = new StringTokenizer(sVarList); tokenizer.hasMoreTokens();)
         {
            String sVarName = tokenizer.nextToken();

            XMLMetadataHelper.validateName(sVarName);
            workflow.addVariable(new Variable(sVarName));
         }
      }

      if (isWorkflowHandler(workflowElement))
      {
         loadWorkflowHandler(workflowElement, workflow, workflow);
      }

      m_flowFixupList = new ArrayList();
      loadActivity(workflowElement.getFirstChild(), workflow);
      m_metadata.addWorkflow(workflow);
      m_helper.fixup(m_flowFixupList.iterator());
      m_flowFixupList = null;

      m_persistenceMappingFixupList.add(new ContextFixup(m_helper)
      {
         public void fixup()
         {
            workflow.resolve(m_machine);
         }
      });
   }
View Full Code Here


    */
   public void addWorkflow(Workflow workflow)
   {
      verifyNotReadOnly();

      Workflow oldWorkflow = (Workflow)m_workflowMap.put(workflow.getName(), Primitive.createInteger(workflow.getVersion()), workflow);

      if (oldWorkflow != null)
      {
         m_workflowMap.put(workflow.getName(), Primitive.createInteger(workflow.getVersion()), oldWorkflow);
         throw new MetadataException("err.meta.workflowDup",
            new Object[]{workflow.getFullName(), getName()});
      }

      oldWorkflow = (Workflow)m_currentWorkflowMap.put(workflow.getName(), workflow);

      if (oldWorkflow != null && workflow.getVersion() < oldWorkflow.getVersion())
      {
         m_currentWorkflowMap.put(workflow.getName(), oldWorkflow);
      }
   }
View Full Code Here

    * @return The workflow object.
    * @throws MetadataLookupException if the workflow does not exist.
    */
   public Workflow getWorkflow(String sName, int nVersion)
   {
      Workflow workflow = (Workflow)m_workflowMap.get(sName, Primitive.createInteger(nVersion));

      if (workflow != null)
      {
         return workflow;
      }
View Full Code Here

   /**
    * @see nexj.core.meta.Metadata#getWorkflow(java.lang.String)
    */
   public Workflow getWorkflow(String sName)
   {
      Workflow workflow = (Workflow)m_currentWorkflowMap.get(sName);

      if (workflow != null)
      {
         return workflow;
      }
View Full Code Here

TOP

Related Classes of nexj.core.meta.workflow.Workflow

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.