Package nexj.core.meta.workflow

Examples of nexj.core.meta.workflow.Script


               else
               {
                  code = sEventName;
               }

               Script script = new Script();

               script.setBody(Pair.list(Pair.list(Symbol.SET, var.getSymbol(), code)));
               activity.addStep(script);
               fork.addConcurrent(activity);
            }

            if (branch == null)
View Full Code Here


                  step.setActivity(activity);
                  loadWorkflowHandler(element, (Handler)step, activity.getFlow());
               }
               else
               {
                  step = new Script(sStepName);
                  step.setActivity(activity);
               }

               String sCleanup = XMLUtil.getStringAttr(element, "cleanup");
View Full Code Here

            String sElement = element.getNodeName();
            Step step;

            if (sElement.equals("Script"))
            {
               Script script = new Script(sStepName);

               script.setActivity(activity);
               script.setBody((Pair)m_helper.parse(m_helper.getElementValue(element),
                  true, activity.getFlow().getPosMap(), Jump.BODY, m_metadata.getGlobalEnvironment()));
               step = script;
            }
            else if (sElement.equals("Transform"))
            {
View Full Code Here

      Symbol collectionSym = collectionVar.getSymbol();
      Symbol indexSym = indexVar.getSymbol();
      Symbol itemSym = itemVar.getSymbol();

      // Loop initializer step
      Script initializer = new Script(sLoopName + ":init");

      initializer.setActivity(activity);
      initializer.setBody(new Pair(
         Pair.list(Symbol.SET, indexSym,
            Pair.list(Symbol.COND,
               Pair.list(Pair.list(Symbol.PAIR_P, collectionSym), collectionSym),
               Pair.list(Pair.list(Symbol.VECTOR_P, collectionSym), Primitive.ZERO_INTEGER)
            )
         ),
         activity.getFlow().getDefaultReturnCode()
      ));

      if (!bUseOldCollectionVar)
      {
         initializer.setBody(new Pair(
            Pair.list(Symbol.SET, collectionSym, collectionExpression),
            initializer.getBody()
         ));
      }

      activity.addStep(initializer);

      // Loop test step
      Decision decision = new Decision(sLoopName + ":branch");
      Branch loopBody = new Branch();

      decision.setActivity(activity);
      loopBody.setDecision(decision);
      loopBody.setCondition(Pair.list(Symbol.COND,
         Pair.list(Pair.list(Symbol.PAIR_P, collectionSym),
            Pair.list(Symbol.NOT, Pair.list(Symbol.NULL_P, indexSym))),
         Pair.list(Pair.list(Symbol.VECTOR_P, collectionSym),
            Pair.list(Symbol.LT, indexSym, Pair.list(Symbol.VECTOR_LENGTH, collectionSym))),
         Pair.list(Symbol.ELSE,
            Pair.list(collectionSym, Pair.quote(XMLMetadataLoader.HAS_NEXT)))
      ));

      // Get current item and advance to next step
      Script getItem = new Script(sLoopName + ":next");

      getItem.setActivity(loopBody);
      getItem.setBody(new Pair(
         Pair.list(Symbol.COND,
            Pair.list(Pair.list(Symbol.PAIR_P, collectionSym),
               Pair.list(Symbol.SET, itemSym, Pair.list(Symbol.CAR, indexSym)),
               Pair.list(Symbol.SET, indexSym, Pair.list(Symbol.CDR, indexSym))
            ),
View Full Code Here

      else if (step instanceof Script)
      {
         openStepElement(step, "Script");
         m_writer.closeElement();

         Script script = (Script)step;

         exportSExpression(script.getBody(), true, true, Jump.BODY, null);

         m_writer.endElement("Script");
      }
      else if (step instanceof Transform)
      {
View Full Code Here

TOP

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

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.