Skip Headers
Oracle® Communications Design Studio Modeling OSM Processes
Release 7.2.4
Go to Design Studio Help Home
Go to Table of Contents
Go to Feedback page

Go to previous page
Go to next page
Mobi · ePub

Internal Custom Java Sender

A basic internal custom Java sender has the following characteristics:

The following example shows the minimal amount of code required for a custom automation plug-in that sends data to run. This example assumes that it is triggered by an automated task.

  package com.mslv.oms.sample.atm_frame;

  import com.mslv.oms.automation.plugin.*;
  import com.mslv.oms.automation.*;
  import javax.jms.TextMessage;
  import java.rmi.*;
  
  public class MyPlugin extends AbstractSendAutomator {
    protected void makeRequest(String inputXML, AutomationContext context,
                   TextMessage outboundMessage)
                   throws com.mslv.oms.automation.AutomationException {
      try {
        TaskContext taskContext = (TaskContext)context;
        String taskName = taskContext.getTaskMnemonic();

        // optional - You can use this code if you want to define your own correlation ID rather than an autogenerated correlation ID.
        Correlator correlator = getCorrelator(context);
        correlator.add(createCustomCorrelationId(taskContext));

        outboundMessage.setText("Received task event for task = " + taskName);}
      catch(javax.jms.JMSException ex) {
        throw new AutomationException(ex); }
      catch(RemoteException x) {
        throw new AutomationException(x); }
    }

    private String createCustomCorrelationId(TaskContext taskContext) {
     // Create a custom correlation ID using task name and unique order history ID
     // Actual correlation calculation depends on solution logic
        String corrId = taskContext.getTaskMnemonic() 
                        + "-" 
                        + String.valueOf(taskContext.getOrderHistoryId());
        return corrId;
    }

  }