Package nexj.core.meta

Examples of nexj.core.meta.Metaclass.invoke()


         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);
      assertEquals(1, ((List)workflow.getValue("assignments")).size());
View Full Code Here


      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);
      assertEquals(1, ((List)workflow.getValue("assignments")).size());
View Full Code Here

      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());

      InstanceList addressList = (InstanceList)contact.getValue("addresses");
View Full Code Here

   public void testWorkflowTrigger() throws Exception
   {
      Metaclass patientClass = getMetadata().getMetaclass("Patient");
      Instance parentPatient, childPatient;

      childPatient = (Instance)patientClass.invoke("new");
      childPatient.setValue("firstName", "child");
      parentPatient = (Instance)patientClass.invoke("new");
      parentPatient.setValue("firstName", "parent");
      ((InstanceArrayList)parentPatient.getValue("children")).add(childPatient);
      commit();
View Full Code Here

      Metaclass patientClass = getMetadata().getMetaclass("Patient");
      Instance parentPatient, childPatient;

      childPatient = (Instance)patientClass.invoke("new");
      childPatient.setValue("firstName", "child");
      parentPatient = (Instance)patientClass.invoke("new");
      parentPatient.setValue("firstName", "parent");
      ((InstanceArrayList)parentPatient.getValue("children")).add(childPatient);
      commit();

      getLogger().debug("Starting workflow on parent");
View Full Code Here

    * a workflow try/catch.
    */
   public void testWorkflowTriggerException()
   {
      Metaclass patientClass = getMetadata().getMetaclass("Patient");
      Instance patient = (Instance)patientClass.invoke("new");

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

      patient.invoke("triggerExceptionStart");
View Full Code Here

  
   public void testTransactions()
   {
      Metaclass contact = getMetadata().getMetaclass("Contact");
     
      contact.invoke("testTxSupported", new Object[]{null, Boolean.TRUE});
     
      assertEquals(1, m_context.getUnitOfWorkCount());
      assertNotNull(m_context.getUnitOfWork().getTransaction());
      assertEquals(Status.STATUS_ACTIVE, m_context.getUnitOfWork().getStatus());
      m_context.commitAndResume(null);
View Full Code Here

   }

   public void testWorkflow()
   {
      Metaclass reqClass = getMetadata().getMetaclass("HRRequest");
      Instance req = (Instance)reqClass.invoke("new",
         new Object[]
         {
            new Pair(Symbol.define("start"), Primitive.toTimestamp("2000-01-01 00:00:00")),
            new Pair(Symbol.define("end"), Primitive.toTimestamp("2000-02-01 00:00:00")),
            new Pair(Symbol.define("applicant"), m_context.getUser())
View Full Code Here

            new Pair(Symbol.define("start"), Primitive.toTimestamp("2000-01-01 00:00:00")),
            new Pair(Symbol.define("end"), Primitive.toTimestamp("2000-02-01 00:00:00")),
            new Pair(Symbol.define("applicant"), m_context.getUser())
         });
      Metaclass workflowClass = getMetadata().getMetaclass(Metadata.WORKFLOW_CLASS_NAME);
      InstanceList workflowList = (InstanceList)workflowClass.invoke("forInstance",
         new Object[]{req});
     
      assertEquals(1, workflowList.size());
     
      commit();
View Full Code Here

   }

   public void testWorkflow2()
   {
      Metaclass reqClass = getMetadata().getMetaclass("HRRequest");
      Instance req = (Instance)reqClass.invoke("new",
         new Object[]
         {
            new Pair(Symbol.define("start"), Primitive.toTimestamp("2000-01-01 00:00:00")),
            new Pair(Symbol.define("end"), Primitive.toTimestamp("2000-02-01 00:00:00")),
            new Pair(Symbol.define("applicant"), m_context.getUser())
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.