SendExternalDemandUpdates service

The SendExternalDemandUpdates service publishes demand updates to a generic JMS queue.

The following steps describe how to locate this service in the Applications Manager.

  1. From the Applications menu of the Applications Manager, click Application Platform.
  2. From the tree in the application rules side panel, double-click Process Modeling.
  3. Click the General tab. In the Process Types swimlane, right-click the General process type, and click Model Process. The Repository Details window and work area display for the General process type.
  4. Click the Service Definitions tab.
  5. Expand the Promising Server Integration branch.
  6. Right-click SendExternalDemandUpdates, and click details. The Service Detail window displays in the work area.
  7. Click the JMS sender and enter the values for the JMS queue parameters. You can also define the values for the JMS queue parameters in the customer_overrides.properties file.

Note: Promising server demand update considerations

When the SendExternalDemandUpdates service is called from the Order server, a demand message is sent to a generic JMS queue. If you are using IBM® WebSphere® MQ as your JMS provider and if you encounter the following error, you need to make some changes to the configuration of this service.

<Error ErrorCode="com.ibm.msg.client.jms.DetailedJMSException"
ErrorDescription="Error description not available"
ErrorRelatedMoreInfo="" ErrorUniqueExceptionId="9.55.49.21213615473287810000000017772">
<Attribute Name="ErrorCode" Value="com.ibm.msg.client.jms.DetailedJMSException"/>
<Attribute Name="ErrorDescription" Value="Error description not available"/>
<Attribute Name="YFS10000" Value=""/>
<Error ErrorCode="com.yantra.yfs.japi.YFSException"

The queue to which the messages are sent needs to be split up so that messages can be diverted to different queues. To accomplish this, you need to modify the service to reflect the condition for diverting messages to multiple queues. For example, as shown in the following diagram, a custom API called INVQueueResolver has been added, which adds the parameter "QueueID" to the message. The QueueID parameter is then used as a condition to divert the messages to different queues.

Custom API diagram

To modify this out-of-the-box service to divert messages to multiple queues:

  1. Add your custom API in the service:
    1. Specify the ApiName as com.ibm.inventory.promising.util.INVQueueResolver.
    2. Specify the MethodName as resolveQueue.
    3. Add and configure a custom API property: NumberOfQueues=<num queues in the service>
  2. Add a condition for each queue.
  3. Add a custom API jar to the application server classpath.

    The following shows a sample code of the custom API:

    package com.ibm.inventory.promising.util;
    
    import java.util.Properties;
    
    import org.w3c.dom.Document;
    
    import com.yantra.interop.japi.YIFCustomApi;
    import com.yantra.yfc.dom.YFCDocument;
    import com.yantra.yfs.japi.YFSEnvironment;
    
    public class INVQueueResolver implements YIFCustomApi {
    
       private int numQueuesConfigured=1;
       private static final String NUM_QUEUE_PARAM="NumberOfQueues";
       private static final String QUEUE_ID ="QueueID";
    
       public void setProperties(Properties prop) throws Exception {
          String strNumQueues=prop.getProperty(NUM_QUEUE_PARAM, "1");
          numQueuesConfigured = Integer.valueOf(strNumQueues);
       }
    
       public Document resolveQueue(YFSEnvironment env , Document inXML){
          int hashCode = inXML.hashCode();
          int queueBucket = hashCode%numQueuesConfigured;
          YFCDocument root = YFCDocument.getDocumentFor(inXML);
          root.getDocumentElement().setAttribute(QUEUE_ID, queueBucket);
          return inXML;
       }
    }