Package nexj.core.meta.workflow

Examples of nexj.core.meta.workflow.State


      try
      {
         m_context.setSecure(false);
         instance = new Instance(metaclass, m_context);

         State state = new State(service, true);

         state.setReservedValue(0, instance);
         state.setReservedValue(1, state);
         state.setValue(Service.OUTPUT, sOutput);
         state.setToken(service, message);

         int i = 0;

         for (Pair pair = args; pair != null; pair = pair.getNext())
         {
            if (i >= service.getArgumentCount())
            {
               i = -1;
               break;
            }
           
            state.setValue(service.getArgument(i++), pair.getHead());
         }

         if (i != service.getArgumentCount())
         {
            throw new IntegrationException("err.integration.service.argCount",
View Full Code Here


   /**
    * @see nexj.core.runtime.sys.SysWorkflow#complete(nexj.core.runtime.Instance, nexj.core.runtime.ActionContext)
    */
   public void complete(Instance instance, ActionContext actx)
   {
      State state = (State)instance.getValue("state");
      Service service = (Service)state.getFlow();
      String sChannel = (String)state.getValue(Service.OUTPUT);
      Channel channel = (StringUtil.isEmpty(sChannel)) ? null : m_context.getMetadata().getChannel(sChannel);
      Object value = state.getToken(null);

      if (s_logger.isDumpEnabled())
      {
         s_logger.dump("Output message:");
         s_logger.dump(value);
View Full Code Here

            m_key.instance = primary;
            m_context.getUnitOfWork().cacheTransient(m_key, list);
            m_key = null;
         }

         State state = new State(flow, true);

         state.setReservedValue(0, instance);
         state.setReservedValue(1, state);

         instance.setNew();
         instance.setValue("name", flow.getName());
         instance.setValue("version", Primitive.createInteger(flow.getVersion()));
         instance.setValue("oid", EMPTY_BINARY);
View Full Code Here

   {
      Instance object = (Instance)instance.getValue("object");

      if (s_logger.isDebugEnabled())
      {
         State state = (State)instance.getValue("state");

         if (state == null)
         {
            s_logger.debug("Completed " + instance + ((object == null) ? "" : " for " + object));
         }
         else
         {
            s_logger.debug("Completed " + state.getFlow() + ((object == null) ? "" : " for " + object));
         }
      }

      if (object != null)
      {
View Full Code Here

            }
         }
         else if (sName.equals("state"))
         {
            Flow flow = getFlow((String)instance.getValue("name"), ((Number)instance.getValue("version")).intValue());
            State state = new State(flow, (String)instance.getValue("serializedState"),
               (String)instance.getValue("serializedVariables"), m_context);

            state.setReservedValue(0, instance);
            state.setReservedValue(1, state);

            instance.setValue("state", state);
         }
      }
   }
View Full Code Here

         public boolean invoke(int nArgCount, Machine machine)
         {
            assert nArgCount == 2;

            TransferObject tobj = (TransferObject)machine.getArg(0, nArgCount);
            State state = (State)machine.getArg(1, nArgCount);

            machine.returnValue(new Transformer((InvocationContext)machine.getContext())
               .transform(tobj, ((Metadata)machine.getContext().getContextMetadata())
                  .getTransformation((String)m_transformation.invoke(machine, state, new Object[] {tobj})),
                  (Pair)m_arguments.invoke(machine, state, new Object[] {tobj})), nArgCount);
View Full Code Here

         {
            assert nArgCount == 2;

            InvocationContext context = (InvocationContext)machine.getContext();
            TransferObject tobj = (TransferObject)machine.getArg(0, nArgCount);
            State state = (State)machine.getArg(1, nArgCount);
            String sChannelName = (m_channel != null) ? (String)m_channel.invoke(machine, state, new Object[]{tobj}) : null;

            if (sChannelName == null)
            {
               sChannelName = (String)tobj.findValue(Sender.CHANNEL);
View Full Code Here

         {
            assert nArgCount == 2;

            InvocationContext context = (InvocationContext)machine.getContext();
            TransferObject tobj = (TransferObject)machine.getArg(0, nArgCount);
            State state = (State)machine.getArg(1, nArgCount);
            String sChannelName = (m_channel != null) ? (String)m_channel.invoke(machine, state, new Object[]{tobj}) : null;

            if (sChannelName == null)
            {
               sChannelName = (String)tobj.findValue(Sender.CHANNEL);
View Full Code Here

    * @see nexj.core.meta.workflow.Persist#configureFormatter()
    */
   protected Object configureFormatter(MessageFormatter messageFormatter, int nArgCount, Machine machine)
   {
      TransferObject tobj = (TransferObject)machine.getArg(0, nArgCount);
      State state = (State) machine.getArg(1, nArgCount);
      final Instance syncLink = (Instance)m_syncLinkExpr.invoke(machine, state, new Object[] {tobj});

      ((ObjectMessageFormatter)messageFormatter).initFormatterStrategy(new Link(syncLink, m_syncScriptExpr, nArgCount,
         machine));

View Full Code Here

      assertEquals(3, result.getValueCount());
      assertEquals("~boo~", result.getValue("boo"));
      assertEquals("!+++++", result.getValue("ego"));
      assertEquals(new Integer(5), result.getValue("iterations"));

      State state = (State)instance.getValue("state");

      assertTrue(state.isFinal());
      assertNull(state.getValue(Service.OUTPUT));
      assertEquals(new Integer(5), state.getValue("i"));
      assertEquals(new Integer(5), state.getValue("count"));

      assertEquals(Instance.DELETED, instance.getState());

      commit();
View Full Code Here

TOP

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

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.