Package nexj.core.meta

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


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

      m_context.setSecure(false);
View Full Code Here


         workflowList.getInstance(i).invoke("delete");
      }

      m_context.setSecure(true);

      workflowClass.invoke("start", new Object[]{req, "HolidayRequest_C", Boolean.FALSE});

      commit();

      Pair attributes = parse("(name version class serializedState serializedVariables (assignments ordinal caption assignee manual (nextStates ordinal caption)) (timers ordinal))");
      Pair orderBy = parse("(((@ assignments ordinal) . #t) ((@ assignments nextStates ordinal) . #t) ((@ timers ordinal) . #t))");
View Full Code Here

      m_context.setSecure(true);

      AssertUtil.assertEqualsIgnoreOIDs(getURL("workflow-HRC3.xml"), workflowList, attributes);
     
      req.setValue("comment", "");
      workflowClass.invoke("start", new Object[]{req, "Exception", Boolean.FALSE});
     
      assertEquals("done", req.getValue("comment"));
     
      // Test startWorkflow static method
      req.setValue("comment", "");
View Full Code Here

     
      // Test startWorkflow static method
      req.setValue("comment", "");
      commit();
      m_context.setSecure(false);
      workflowClass.invoke("startWorkflow", new Object[]{"Exception", "HRRequest", "(= comment \"\")" , Boolean.FALSE});
      m_context.setSecure(true);
      assertEquals("done", req.getValue("comment"));

      req.setValue("comment", "");
      commit();
View Full Code Here

      assertEquals("done", req.getValue("comment"));

      req.setValue("comment", "");
      commit();
      m_context.setSecure(false);
      workflowClass.invoke("startWorkflow", new Object[]{"Exception", "HRRequest", Pair.attribute("comment").eq(""), Boolean.FALSE});
      m_context.setSecure(true);
      assertEquals("done", req.getValue("comment"));
   }

   public void testService()
View Full Code Here

      Metaclass serviceClass = getMetadata().getMetaclass(Metadata.SERVICE_CLASS_NAME);
      TransferObject tobj = new TransferObject();

      tobj.setValue("ego", "!");

      Instance instance = (Instance)serviceClass.invoke("invoke", new Object[]{"Counter", tobj, null, new Integer(5)});

      assertEquals(Boolean.TRUE, instance.invoke("done"));

      TransferObject result = (TransferObject)instance.invoke("result");
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.
View Full Code Here

      matrixRow.add(Primitive.createInteger(6));
      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));
View Full Code Here

   public void testWorkflowTryFinallyInFork() throws Exception
   {
      Metaclass assignmentClass = getMetadata().getMetaclass("SysWorkflowAssignment");
      InstanceList assignmentList;
      Metaclass primaryClass = getMetadata().getMetaclass("WorkflowTrace");
      Instance primary = (Instance)primaryClass.invoke("new");

      // Test 1: No exception
      primary.setValue("trace", null);
      primary.setValue("throwUncaughtEx", Boolean.FALSE);
      primary.setValue("throwInnerEx", Boolean.FALSE);
View Full Code Here

    * Tests the Finally part of a Workflow Try block.
    */
   public void testWorkflowTryFinally() throws Exception
   {
      Metaclass primaryClass = getMetadata().getMetaclass("WorkflowTrace");
      Instance primary = (Instance)primaryClass.invoke("new");

      primary.invoke("go");
      commit();
      assertEquals("THROWBLOCK;END_THROWBLOCK;F_INNER;F_OUTER;", primary.getValue("trace"));

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.