Package nexj.core.runtime

Examples of nexj.core.runtime.Instance.invoke()


         instance = (Instance)serviceClass.invoke("invoke", new Object[]{"TryFinally", tobj, null});
         fail();
      }
      catch (ScriptingException ex)
      {
         result = (TransferObject)instance.invoke("result");
         assertEquals("THROWBLOCK;F_INNER;F_OUTER;", result.getValue("trace"));
      }
   }

View Full Code Here


      workflowList = (InstanceList)workflowClass.invoke("forInstance",
         new Object[]{contact});
      assertEquals(0, workflowList.size());

      contact.invoke("start");
      commit();
      workflowList = (InstanceList)workflowClass.invoke("forInstance",
         new Object[]{contact});
      assertEquals(1, workflowList.size());
      workflow = workflowList.getInstance(0);
View Full Code Here

         new Object[]{contact});
      assertEquals(1, workflowList.size());
      workflow = workflowList.getInstance(0);
      assertEquals(1, ((List)workflow.getValue("assignments")).size());

      contact.invoke("process");
      commit();
      workflowList = (InstanceList)workflowClass.invoke("forInstance",
         new Object[]{contact});
      assertEquals(1, workflowList.size());
      workflow = workflowList.getInstance(0);
View Full Code Here

         new Object[]{contact});
      assertEquals(1, workflowList.size());
      workflow = workflowList.getInstance(0);
      assertEquals(1, ((List)workflow.getValue("assignments")).size());

      contact.invoke("break");
      commit();
      workflowList = (InstanceList)workflowClass.invoke("forInstance",
         new Object[]{contact});
      assertEquals(0, workflowList.size());
View Full Code Here

      parentPatient.setValue("firstName", "parent");
      ((InstanceArrayList)parentPatient.getValue("children")).add(childPatient);
      commit();

      getLogger().debug("Starting workflow on parent");
      parentPatient.invoke("triggerTestStart");
      commit();

      // Triggering child to wake from queue
      childPatient.invoke("triggerTest");
      commit();
View Full Code Here

      assertEquals(1, workflowList.size());

      State state = (State)((Instance)workflowList.get(0)).getValue("state");

      assertEquals("6", state.toString());
      parentPatient.invoke("triggerTest");
      assertTrue(state.isFinal());
   }

   /**
    * Tests that an exception thrown in a trigger script step is caught by
View Full Code Here

      Instance patient = (Instance)patientClass.invoke("new");

      patient.setValue("firstName", "John");
      commit();

      patient.invoke("triggerExceptionStart");
      commit();

      // Fire the trigger that throws an exception
      patient.invoke("triggerException");
      commit();
View Full Code Here

      patient.invoke("triggerExceptionStart");
      commit();

      // Fire the trigger that throws an exception
      patient.invoke("triggerException");
      commit();
   }
}
View Full Code Here

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

      commit();

      instance = (Instance)serviceClass.invoke("invoke", new Object[]{"Jump", "jmp", null});
      assertEquals("yo! jmp", instance.invoke("result"));

      commit();

      // Test Loops.service, which uses the Loop service element.
      ArrayList matrixRowList = new ArrayList(2);
View Full Code Here

      matrixRowList.add(matrixRow = new ArrayList(2));
      matrixRow.add(Primitive.createInteger(5));
      matrixRow.add(Primitive.createInteger(4));

      instance = (Instance)serviceClass.invoke("invoke", new Object[]{"Loops", tobj, null, Primitive.createInteger(2)});
      result = (TransferObject)instance.invoke("result");
      assertEquals(Primitive.createInteger(64), ((List)((List)result.getValue("data")).get(0)).get(0));
      assertEquals(Primitive.createInteger(49), ((List)((List)result.getValue("data")).get(0)).get(1));
      assertEquals(Primitive.createInteger(36), ((List)((List)result.getValue("data")).get(0)).get(2));
      assertEquals(Primitive.createInteger(25), ((List)((List)result.getValue("data")).get(1)).get(0));
      assertEquals(1, ((List)((List)result.getValue("data")).get(1)).size());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.