Package nexj.core.meta.integration

Examples of nexj.core.meta.integration.Message


      if (table.getMessageCount() == 0 && table.getFormat() == null)
      {
         return tobj;
      }

      Message message = table.findMessage(tobj.getClassName());

      if (message == null)
      {
         throw new IntegrationException("err.integration.service.invalidRequest",
            new Object[]{tobj.getClassName(), getName()});
      }

      if (message.getFormat() == null)
      {
         return tobj;
      }

      ObjectOutput output = sender.createOutput();
      ((MessageFormatter)message.getFormat().getFormatter().getInstance(context)).format(tobj, message, output);

      TransferObject raw = new TransferObject(1);

      raw.setValue(Sender.BODY, output.getObject());
      sender.prepare(raw, tobj, message);
View Full Code Here


      // Group the branches by message
      for (int i = 0, n = getBranchCount(); i != n; ++i)
      {
         Branch branch = getBranch(i);
         Message message = (branch instanceof Case) ? ((Case)branch).getMessage() : null;

         if (message != null)
         {
            List list = (List)messageMap.get(message.getName());

            if (list == null)
            {
               list = new ArrayList(4);
               messageMap.put(message.getName(), list);
            }
           
            list.add(branch);
         }
         else
View Full Code Here

   {
      Metaclass contactClass = getMetadata().getMetaclass("Contact");
      Metaclass patientClass = getMetadata().getMetaclass("Patient");
      Metaclass surgeonClass = getMetadata().getMetaclass("Surgeon");
      Metaclass doctorClass = getMetadata().getMetaclass("Doctor");
      Message selected;


      assertEquals(m_contactMsg, ((ObjectMessagePartMapping)m_contactMsg.getRoot().getMapping()).findMessage(contactClass));
      assertEquals(m_patientMsg, ((ObjectMessagePartMapping)m_contactMsg.getRoot().getMapping()).findMessage(patientClass));
      assertEquals(m_surgeonMsg, ((ObjectMessagePartMapping)m_contactMsg.getRoot().getMapping()).findMessage(surgeonClass));
View Full Code Here

   {
      Metaclass contactClass = getMetadata().getMetaclass("Contact");
      Metaclass doctorClass = getMetadata().getMetaclass("Doctor");
      Metaclass surgeonClass = getMetadata().getMetaclass("Surgeon");
      Metaclass specialClass = getMetadata().getMetaclass("Special");
      Message contactMsg = new Message("ContactMessage");
      Message doctorMsg = new Message("DoctorMessage");
      Message surgeonMsg1 = new Message("SurgeonMessage1");
      Message surgeonMsg2 = new Message("SurgeonMessage2");
      CompositeMessagePartInstance contactPart = new CompositeMessagePartInstance(contactMsg.getName());
      CompositeMessagePartInstance doctorPart = new CompositeMessagePartInstance(doctorMsg.getName());
      CompositeMessagePartInstance surgeonPart1 = new CompositeMessagePartInstance(surgeonMsg1.getName());
      CompositeMessagePartInstance surgeonPart2 = new CompositeMessagePartInstance(surgeonMsg2.getName());
      ObjectMessagePartMapping contactMapping = new ObjectMessagePartMapping();
      ObjectMessagePartMapping doctorMapping = new ObjectMessagePartMapping();
      ObjectMessagePartMapping surgeonMapping1 = new ObjectMessagePartMapping();
      ObjectMessagePartMapping surgeonMapping2 = new ObjectMessagePartMapping();

      contactMsg.setRoot(contactPart);
      doctorMsg.setRoot(doctorPart);
      surgeonMsg1.setRoot(surgeonPart1);
      surgeonMsg2.setRoot(surgeonPart2);

      contactPart.setDeclarator(contactMsg);
      doctorPart.setDeclarator(doctorMsg);
      surgeonPart1.setDeclarator(surgeonMsg1);
      surgeonPart2.setDeclarator(surgeonMsg2);

      doctorMsg.setBaseMessage(contactMsg);
      contactMsg.addDerivedMessage(doctorMsg);
      surgeonMsg1.setBaseMessage(doctorMsg);
      doctorMsg.addDerivedMessage(surgeonMsg1);
      surgeonMsg2.setBaseMessage(doctorMsg);
      doctorMsg.addDerivedMessage(surgeonMsg2);

      contactPart.setMapping(contactMapping);
      doctorPart.setMapping(doctorMapping);
      surgeonPart1.setMapping(surgeonMapping1);
View Full Code Here

    * Tests that the XSD and XSI namespaces get added when formatting type: any subtype: xsi.
    * Also tests that one can specify a well-known namespace (e.g. "soap") on a part, without specifying a URI.
    */
   public void testFormatSingleElementAny()
   {
      Message message = m_context.getMetadata().getMessage("XML_SingleElementAny");
      TransferObject root = new TransferObject(message.getName(), 1);

      root.setValue("value", "test");

      StringWriter writer = new StringWriter();
      WriterOutput out = new WriterOutput(writer);
View Full Code Here

      assertEquals(NUM_MESSAGES, formatRecList.size());

      // Format the TO
      StringWriter writer = new StringWriter();
      Message msg = Repository.getMetadata().getMessage(sMessageName);

      m_formatter.format(formatRoot, msg, new WriterOutput(writer));

      Logger logger = Logger.getLogger("FixedMessageParserTest");
View Full Code Here

    * of how it is interspersed with child elements, goes into the
    * value-mapped message part.
    */
   public void testValuePartGetsAllCharacterContent() throws Exception
   {
      Message message = m_context.getMetadata().getMessage("XML_ValuePart");
      TransferObject tobj;

      tobj = m_parser.parse(new StringInput(
         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
         "<outer attr=\"tst\">" +
View Full Code Here

   /**
    * Tests optional value-mapped part when its element is empty.
    */
   public void testEmptyValuePart()
   {
      Message message = m_context.getMetadata().getMessage("XML_ValuePart");
      TransferObject tobj;

      tobj = m_parser.parse(new StringInput(
         "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
         "<outer attr=\"tst\">" +
View Full Code Here

   /**
    * Tests required value-mapped part when its element is empty.
    */
   public void testEmptyRequiredValuePart()
   {
      Message message = m_context.getMetadata().getMessage("XML_ValuePartReq");

      try
      {
         m_parser.parse(new StringInput(
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here

   /**
    * Message with root node reference to another message, using a different envelope than the referent.
    */
   public void testFormatMessageWithRootRef()
   {
      Message message = m_context.getMetadata().getMessage("SOAP12_PatientDemographics");
      TransferObject root = new TransferObject();
      TransferObject tobj;
      List list;
      StringWriter writer = new StringWriter();

View Full Code Here

TOP

Related Classes of nexj.core.meta.integration.Message

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.