/** * A record with this datasource handle changed, notify any behaviors that are checking. * NOTE: Be very careful as this code is running in an independent thread * (synchronize to the task before calling record calls). * NOTE: For now, you are only notified of the main record changes. * @param message The message to handle. * @return The error code. */ public int handleMessage(BaseMessage message) { if (message != null) if (message.getMessageHeader().getRegistryIDMatch() != null) // My private message if (message.getMessageHeader().getRegistryIDMatch().equals(m_intRegistryID)) // My private message { Application app = (Application)this.getTask().getApplication(); String strMessage = app.getResources(ResourceConstants.DEFAULT_RESOURCE, true).getString("Remote action completed"); this.getTask().setStatusText(strMessage, Constants.INFORMATION); message.consume(); } return super.handleMessage(message); }
/** * A record with this datasource handle changed, notify any behaviors that are checking. * NOTE: Be very careful as this code is running in an independent thread * (synchronize to the task before calling record calls). * NOTE: For now, you are only notified of the main record changes. * @param message The message to handle. * @return The error code. */ public int handleMessage(BaseMessage message) { if (message != null) if (message.getMessageHeader().getRegistryIDMatch() != null) // My private message if (message.getMessageHeader().getRegistryIDMatch().equals(m_intRegistryID)) // My private message { Application app = (Application)this.getTask().getApplication(); String strMessage = app.getResources(ResourceConstants.DEFAULT_RESOURCE, true).getString("Remote action completed"); this.getTask().setStatusText(strMessage, Constants.INFORMATION); message.consume(); } return super.handleMessage(message); }
String strQueueName = messageHeader.getQueueName(); String strQueueType = messageHeader.getQueueType(); Integer intRegID = messageHeader.getRegistryIDMatch(); JSONObject jsonObj = new JSONObject();
if (message.getMessageHeader().getRegistryIDMatch() != null) // My private message
strReturnQueueName = MessageConstants.TRX_RETURN_QUEUE; TrxMessageHeader privateMessageHeader = new TrxMessageHeader(strReturnQueueName, MessageConstants.INTERNET_QUEUE, null); if (message.getMessageHeader().getRegistryIDMatch() == null) message.getMessageHeader().setRegistryIDMatch(intRegistryID); privateMessageHeader.setRegistryIDMatch(message.getMessageHeader().getRegistryIDMatch()); message.setMessageHeader(privateMessageHeader);