Package nexj.core.meta.workflow

Examples of nexj.core.meta.workflow.Assignment


    * @return The outer step.
    */
   public Step loadSemaphore(Element element, String sStepName,
      Activity outerActivity, Machine machine, ActivityLoader loader)
   {
      Assignment assignment = new Assignment(sStepName + ":Assignment");

      assignment.setActivity(outerActivity);
      assignment.setQueue(parseQueueName(XMLUtil.getStringAttr(element, "queue"), outerActivity, machine));
      assignment.setCaption(m_helper.parse(XMLUtil.getStringAttr(element, "title"),
         false, outerActivity.getFlow().getPosMap(), XMLUtil.getStringAttr(element, "caption"),
         m_metadata.getGlobalEnvironment()));
      assignment.setAssignee(m_helper.parse(XMLUtil.getStringAttr(element, "assignee"),
         false, outerActivity.getFlow().getPosMap(), assignment.getAssignee(), m_metadata.getGlobalEnvironment()));
      assignment.setOwner(m_helper.parse(XMLUtil.getStringAttr(element, "owner"),
         false, outerActivity.getFlow().getPosMap(), assignment.getOwner(), m_metadata.getGlobalEnvironment()));
      assignment.setFactory((Pair)m_helper.parse(XMLUtil.getStringAttr(element, "factory"),
         true, outerActivity.getFlow().getPosMap(), assignment.getFactory(),
         m_metadata.getGlobalEnvironment()));
      assignment.setSemaphore(true);
      outerActivity.addStep(assignment);

      Block block = new Block();

      block.setActivity(outerActivity);
      assignment.setNext(block);

      Activity blockActivity = block.getContainedActivity();

      Semaphore semaphore = new Semaphore(sStepName, assignment);

View Full Code Here


               step = join;
            }
            else if (sElement.equals("Assignment"))
            {
               Flow workflow = activity.getFlow();
               Assignment assignment = new Assignment(sStepName);

               assignment.setActivity(activity);
               assignment.setQueue(parseQueueName(XMLUtil.getStringAttr(element, "queue"), activity, m_machine));
               assignment.setPriority(m_helper.parse(XMLUtil.getStringAttr(element, "priority"),
                  false, workflow.getPosMap(), assignment.getPriority(), m_metadata.getGlobalEnvironment()));
               assignment.setAssignee(m_helper.parse(XMLUtil.getStringAttr(element, "assignee"),
                  false, workflow.getPosMap(), assignment.getAssignee(), m_metadata.getGlobalEnvironment()));
               assignment.setOwner(m_helper.parse(XMLUtil.getStringAttr(element, "owner"),
                  false, workflow.getPosMap(), assignment.getOwner(), m_metadata.getGlobalEnvironment()));
               assignment.setCaption(m_helper.parse(XMLUtil.getStringAttr(element, "title"),
                  false, workflow.getPosMap(), XMLUtil.getStringAttr(element, "caption"),
                  m_metadata.getGlobalEnvironment()));
               assignment.setFactory((Pair)m_helper.parse(XMLUtil.getStringAttr(element, "factory"),
                  true, workflow.getPosMap(), assignment.getFactory(),
                  m_metadata.getGlobalEnvironment()));

               boolean bTarget = loadTarget(element, assignment, Boolean.TRUE, null, false);

               activity.addStep(assignment);

               if (isWorkflowHandler(element))
               {
                  AutoCompletion unassignment = new AutoCompletion(assignment);

                  loadWorkflowHandler(element, unassignment, workflow);
                  step = unassignment;
               }
               else
               {
                  step = new ManualCompletion(assignment);
               }

               nextElement = XMLUtil.findFirstElement(element.getNextSibling());

               if (nextElement != null)
               {
                  if (nextElement.getNodeName().equals("UIAction"))
                  {
                     loadTarget(element, assignment, Boolean.TRUE, null, bTarget);
                  }
                  else
                  {
                     nextElement = null;
                  }
               }

               assignment.setNext(step);
            }
            else if (sElement.equals("Semaphore"))
            {
               step = loadSemaphore(element, sStepName, activity, m_machine, new ActivityLoader()
               {
                  public void loadActivity(Element element, Activity activity)
                  {
                     XMLMetadataLoader.this.loadActivity(element.getFirstChild(), activity);
                  }
               });
            }
            else if (sElement.equals("Goto"))
            {
               step = new Goto();
               step.setActivity(activity);
            }
            else if (sElement.equals("Queue"))
            {
               final Flow workflow = activity.getFlow();
               Assignment assignment = new Assignment(sStepName);

               assignment.setActivity(activity);
               assignment.setQueue(parseQueueName(XMLUtil.getStringAttr(element, "queue"), activity, m_machine));
               assignment.setPriority(m_helper.parse(XMLUtil.getStringAttr(element, "priority"),
                  false, workflow.getPosMap(), assignment.getPriority(), m_metadata.getGlobalEnvironment()));
               assignment.setAssignee(m_helper.parse(XMLUtil.getStringAttr(element, "assignee"),
                  false, workflow.getPosMap(), assignment.getAssignee(), m_metadata.getGlobalEnvironment()));
               assignment.setOwner(m_helper.parse(XMLUtil.getStringAttr(element, "owner"),
                  false, workflow.getPosMap(), assignment.getOwner(), m_metadata.getGlobalEnvironment()));
               assignment.setCaption(m_helper.parse(XMLUtil.getStringAttr(element, "title"),
                  false, workflow.getPosMap(), XMLUtil.getStringAttr(element, "caption"),
                  m_metadata.getGlobalEnvironment()));
               assignment.setFactory((Pair)m_helper.parse(XMLUtil.getStringAttr(element, "factory"),
                  true, workflow.getPosMap(), assignment.getFactory(),
                  m_metadata.getGlobalEnvironment()));

               activity.addStep(assignment);
               step = loadQueue(element, assignment);
            }
View Full Code Here

TOP

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

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.