コード例 #1
0
  public static void addDataEntry(Message message, Object name, Object value) throws JMSException {
    Hashtable dataTable = null;

    if (!message.propertyExists(MessagePropertyNames.DATA_TABLE)) {
      dataTable = new Hashtable();
    } else {
      dataTable = (Hashtable) message.getObjectProperty(MessagePropertyNames.DATA_TABLE);
    }

    dataTable.put(name, value);

    if (!message.propertyExists(MessagePropertyNames.DATA_TABLE)) {
      message.setObjectProperty(MessagePropertyNames.DATA_TABLE, dataTable);
    }
  }
コード例 #2
0
  public static void addAttachment(Message message, Object name, Object value) throws JMSException {
    Hashtable headerTable = null;

    if (!message.propertyExists(MessagePropertyNames.ATTACHMENT_TABLE)) {
      headerTable = new Hashtable();
    } else {
      headerTable = (Hashtable) message.getObjectProperty(MessagePropertyNames.ATTACHMENT_TABLE);
    }

    headerTable.put(name, value);

    if (!message.propertyExists(MessagePropertyNames.ATTACHMENT_TABLE)) {
      message.setObjectProperty(MessagePropertyNames.ATTACHMENT_TABLE, headerTable);
    }
  }
コード例 #3
0
  public static String getEventProcessName(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_PROCESS_NAME)) {
      return EVENT_PROCESS_NAME_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.EVENT_PROCESS_NAME);
  }
コード例 #4
0
  public static String getCompInstName(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.COMP_INST_NAME)) {
      return COMP_INST_NAME_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.COMP_INST_NAME);
  }
コード例 #5
0
  public static String getSink(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.SINK)) {
      return null;
    }

    return message.getStringProperty(MessagePropertyNames.SINK);
  }
コード例 #6
0
  public static String getWorkFlowInstId(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.WORK_FLOW_INST_ID)) {
      return WORK_FLOW_INST_ID_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.WORK_FLOW_INST_ID);
  }
コード例 #7
0
  public static String getUserDefinedId(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.USER_DEFINED_DOC_ID)) {
      return USER_DEFINED_DOC_ID_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.USER_DEFINED_DOC_ID);
  }
コード例 #8
0
  public static String getComment(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.COMMENT)) {
      return COMMENT_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.COMMENT);
  }
コード例 #9
0
  public static boolean getIsAlert(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.IS_ALERT)) {
      return false;
    }

    return message.getBooleanProperty(MessagePropertyNames.IS_ALERT);
  }
コード例 #10
0
  public static String getDocumentID(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.DOCUMENT_ID)) {
      return DOCUMENT_ID_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.DOCUMENT_ID);
  }
コード例 #11
0
  public static String getPortName(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.PORT_NAME)) {
      return PORT_NAME_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.PORT_NAME);
  }
コード例 #12
0
  public static String getSourceFPSName(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.SOURCE)) {
      return SOURCE_FPS_NAME_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.SOURCE);
  }
コード例 #13
0
  public static long getTotalTime(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.TOTAL_TIME)) {
      return TOTAL_TIME_DEF;
    }

    return message.getLongProperty(MessagePropertyNames.TOTAL_TIME);
  }
コード例 #14
0
  public static int getEventID(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_ID)) {
      return EVENT_ID_DEF;
    }

    return message.getIntProperty(MessagePropertyNames.EVENT_ID);
  }
コード例 #15
0
  public static String getEventProcessVersion(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_PROCESS_VERSION)) {
      return EVENT_PROCESS_VERSION_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.EVENT_PROCESS_VERSION);
  }
コード例 #16
0
  public static String getEventCategory(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_CATEGORY)) {
      return EVENT_MODULE_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.EVENT_CATEGORY);
  }
コード例 #17
0
  public static String getEventDescription(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_DESCRIPTION)) {
      return EVENT_DESCRIPTION_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.EVENT_DESCRIPTION);
  }
コード例 #18
0
  public static int getEventType(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_TYPE)) {
      return 0;
    }

    return message.getIntProperty(MessagePropertyNames.EVENT_TYPE);
  }
コード例 #19
0
  public static long getEventGenerationDate(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_GENERATION_DATE)) {
      return 0L;
    }

    return message.getLongProperty(MessagePropertyNames.EVENT_GENERATION_DATE);
  }
コード例 #20
0
  public static String getEventStatus(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_STATUS)) {
      return EVENT_STATUS_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.EVENT_STATUS);
  }
コード例 #21
0
  public static Hashtable getDataTable(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.DATA_TABLE)) {
      return DATA_TABLE_DEF;
    }

    return (Hashtable) message.getObjectProperty(MessagePropertyNames.DATA_TABLE);
  }
コード例 #22
0
 public static Hashtable getAttachments(Message message) throws JMSException {
   if (!message.propertyExists(MessagePropertyNames.ATTACHMENT_TABLE)) {
     return ATTACHMENT_TABLE_DEF;
   }
   Hashtable attachments = new Hashtable();
   attachments.putAll((Map) message.getObjectProperty(MessagePropertyNames.ATTACHMENT_TABLE));
   return attachments;
 }
コード例 #23
0
  public static Object getDataEntry(Message message, Object name) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.DATA_TABLE)) {
      return DATA_PROP_DEF;
    }

    Hashtable datTable = (Hashtable) message.getObjectProperty(MessagePropertyNames.DATA_TABLE);

    return datTable.get(name);
  }
コード例 #24
0
  public static Object getAttachment(Message message, String name) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.ATTACHMENT_TABLE)) {
      return ATTACHMENT_PROP_DEF;
    }

    Hashtable attachmentTable;
    attachmentTable = (Hashtable) message.getObjectProperty(MessagePropertyNames.ATTACHMENT_TABLE);
    return attachmentTable.get(name);
  }
コード例 #25
0
  public static String getTextData(Message message) throws JMSException {
    if (message instanceof TextMessage) {
      return ((TextMessage) message).getText();
    }

    if (!message.propertyExists(MessagePropertyNames.TEXT_DATA)) {
      return TEXT_DATA_DEF;
    }

    return message.getStringProperty(MessagePropertyNames.TEXT_DATA);
  }
コード例 #26
0
  public static byte[] getBytesData(Message message) throws JMSException {
    if (message instanceof BytesMessage) {
      BytesMessage bytesMessage = (BytesMessage) message;
      byte bytes[] = new byte[(int) bytesMessage.getBodyLength()];
      bytesMessage.readBytes(bytes);
      return bytes;
    }

    if (!message.propertyExists(MessagePropertyNames.BYTES_DATA)) {
      return BYTES_DATA_DEF;
    }

    return (byte[]) message.getObjectProperty(MessagePropertyNames.BYTES_DATA);
  }
コード例 #27
0
 public static CarryForwardContext getCarryForwardContext(Message message) throws JMSException {
   if (!message.propertyExists(MessagePropertyNames.CARRY_FORWARD_CONTEXT)) {
     return CarryForwardContext.getDefault();
   }
   String carryForwardContextJson =
       message.getStringProperty(MessagePropertyNames.CARRY_FORWARD_CONTEXT);
   if (!StringUtil.isEmpty(carryForwardContextJson)) {
     Genson genson = new Genson();
     CarryForwardContext carryForwardContext =
         genson.deserialize(carryForwardContextJson, CarryForwardContext.class);
     return carryForwardContext;
   }
   return CarryForwardContext.getDefault();
 }
コード例 #28
0
  public static String getEventProcessEnv(Message message) throws JMSException {
    if (!message.propertyExists(MessagePropertyNames.EVENT_PROCESS_ENVIRONMENT))
      return EVENT_PROCESS_EVN_DEF;

    return message.getStringProperty(MessagePropertyNames.EVENT_PROCESS_ENVIRONMENT);
  }