com.genesyslab.omsdk.mil
Interface MILInteractionManager


public interface MILInteractionManager

Creates and manages MILInteraction objects submitted to Interaction Server.

This interface includes asynchronous methods to perform requests on interactions submitted to Interaction Server.

To get a MILInteractionManager instance, call the MILFactory.getInteractionManager() method, as shown in the following code snippet.

MILInteractionManager isManager =
    milFactory.getInteractionManager();

Use this interface to create a new interaction, by calling createInteraction(). Then, set interaction properties using a MILISInteractionParameters instance as shown here:

// Creating a new inbound interaction
MILInteraction milInteraction =
    isManager.createInteraction("Inbound", "InboundNew","thirdPartyMedia");

MILISInteractionParameters milISParam =
    milInteraction.getISParameters();

//Setting a property
milISParam.setProperty("data_name", "data_value");
If you wish to save interaction properties in UCS, get and fill in a MILUCSInteractionParameters object, as shown in the following code snippet:
MILUCSInteractionParameters milUCSParam =
    milInteraction.getUCSParameters();

//Setting a property
milUCSParam.setProperty("data_name", "data_value");

When calling the MILUCSManager.saveInteraction() method, only UCS interaction parameters are stored in UCS.


Submit the interaction to Interaction Server by calling the asyncSubmit() or submit() method.

Note: Only Interaction Server interaction parameters are submitted with the interaction to Interaction Server. After a successful submission, use the changeProperties() method to change the Interaction Server interaction properties.

isManager.submit(milInteraction);

//Adding a new property "new_data_name"

HashMap added = new HashMap();
added.put("new_data_name", "new_data_value");
//Removing "data_name"

HashMap removed = new HashMap();
removed.put("data_name", "data_value");

//Submitting the changes
isManager.changeProperties(milInteraction.getID(),added,null,removed);

To stop processing the interaction, call the stopProcessing() method, as shown here.

//Creating a reason for stopping
//REASON_CODE = 0
MILStopProcessingReason stopReason = MILStopProcessingReason.createAbandoned(REASON_CODE);
isManager.stopProcessing(milInteraction.getID(),stopReason);

Since:
7.1.000.000

Method Summary
 MILSynchronizer asyncChangeProperties(java.lang.String interactionId, java.util.Map changedProperties, java.util.Map removedProperties)
          Changes interaction properties without waiting for the operation result.
 MILSynchronizer asyncChangeProperties(java.lang.String interactionId, java.util.Map addedProperties, java.util.Map changedProperties, java.util.Map removedProperties)
          Deprecated. use asyncChangeProperties(String,java.util.Map,java.util.Map) instead
 MILSynchronizer asyncStopProcessing(java.lang.String id, MILStopProcessingReason reason)
          Stops the specified MILInteraction and returns without waiting for the operation result.
 MILSynchronizer asyncSubmit(MILInteraction interaction)
          Submits the specified MILInteraction and returns without waiting until the operation is done.
 void changeProperties(java.lang.String interactionId, java.util.Map changedProperties, java.util.Map removedProperties)
          Changes the Interaction Server interaction properties of a submitted interaction and waits for the operation result.
 void changeProperties(java.lang.String interactionId, java.util.Map addedProperties, java.util.Map changedProperties, java.util.Map removedProperties)
          Deprecated. use changeProperties(String,java.util.Map,java.util.Map) instead
 MILInteraction createInteraction(java.lang.String type, java.lang.String subtype, java.lang.String mediatype)
          Creates a new MILInteraction and initializes it with the values specified as arguments.
 void stopProcessing(java.lang.String id, MILStopProcessingReason reason)
          Stops processing the interaction and waits for the operation result.
 void submit(MILInteraction interaction)
          Submits the specified MILInteraction and waits for the operation result.
 

Method Detail

createInteraction

public MILInteraction createInteraction(java.lang.String type,
                                        java.lang.String subtype,
                                        java.lang.String mediatype)
Creates a new MILInteraction and initializes it with the values specified as arguments. These parameters are mandatory for submitting the interaction to Interaction Server. If any parameter is null, submitting this interaction fails.

Parameters:
type - interaction type.
subtype - interaction subtype.
mediatype - media type.
Returns:
a new interaction instance.
See Also:
submit(com.genesyslab.omsdk.mil.MILInteraction)

submit

public void submit(MILInteraction interaction)
            throws MILRequestFailedException
Submits the specified MILInteraction and waits for the operation result.

Parameters:
interaction - interaction to submit.
Throws:
MILRequestFailedException - Exception thrown if mandatory interaction parameters are null or invalid, or if the interaction’s ID already exits.

stopProcessing

public void stopProcessing(java.lang.String id,
                           MILStopProcessingReason reason)
                    throws MILRequestFailedException
Stops processing the interaction and waits for the operation result.

Parameters:
id - ID of the interaction to be stopped.
reason - reason for stopping processing.
Throws:
MILRequestFailedException - Exception thrown if the request fails.

changeProperties

public void changeProperties(java.lang.String interactionId,
                             java.util.Map addedProperties,
                             java.util.Map changedProperties,
                             java.util.Map removedProperties)
                      throws MILRequestFailedException
Deprecated. use changeProperties(String,java.util.Map,java.util.Map) instead

Changes the Interaction Server interaction properties of a submitted interaction and waits for the operation result.

Parameters:
interactionId - ID of the interaction whose properties should be changed.
addedProperties - properties to be added.
changedProperties - properties to be changed.
removedProperties - properties to be deleted (values are ignored).
Throws:
MILRequestFailedException - exception thrown if the request fails prior to sending due to invalid parameters, or if Interaction Server rejects modifications to read-only properties such as TenantId or SubmittedBy.

Note: For an error in read-only properties, the entire request is rejected and no properties are changed.


changeProperties

public void changeProperties(java.lang.String interactionId,
                             java.util.Map changedProperties,
                             java.util.Map removedProperties)
                      throws MILRequestFailedException
Changes the Interaction Server interaction properties of a submitted interaction and waits for the operation result.

Parameters:
interactionId - ID of the interaction whose properties should be changed.
changedProperties - properties to be changed.
removedProperties - properties to be deleted (values are ignored).
Throws:
MILRequestFailedException - exception thrown if the request fails prior to sending due to invalid parameters, or if Interaction Server rejects modifications to read-only properties such as TenantId or SubmittedBy.

Note: For an error in read-only properties, the entire request is rejected and no properties are changed.


asyncSubmit

public MILSynchronizer asyncSubmit(MILInteraction interaction)
                            throws MILRequestFailedException
Submits the specified MILInteraction and returns without waiting until the operation is done.

Use the returned MILSynchronizer to wait for the operation result.

Parameters:
interaction - interaction to submit.
Returns:
synchronizer for this operation.
Throws:
MILRequestFailedException - exception thrown if the request fails.

asyncStopProcessing

public MILSynchronizer asyncStopProcessing(java.lang.String id,
                                           MILStopProcessingReason reason)
                                    throws MILRequestFailedException
Stops the specified MILInteraction and returns without waiting for the operation result.

Note: Use the returned MILSynchronizer to wait for the operation result.

Parameters:
id - ID of the interaction to be stopped.
reason - reason for stopping processing.
Returns:
synchronizer for this operation.
Throws:
MILRequestFailedException - exception thrown if the request fails.

asyncChangeProperties

public MILSynchronizer asyncChangeProperties(java.lang.String interactionId,
                                             java.util.Map addedProperties,
                                             java.util.Map changedProperties,
                                             java.util.Map removedProperties)
                                      throws MILRequestFailedException
Deprecated. use asyncChangeProperties(String,java.util.Map,java.util.Map) instead

Changes interaction properties without waiting for the operation result.

Use the returned MILSynchronizer to wait for the operation result.

Parameters:
interactionId - ID of the interaction whose properties should be changed.
addedProperties - properties to be added.
changedProperties - properties to be changed.
removedProperties - properties to be deleted (values are ignored).
Returns:
synchronizer for this operation.
Throws:
MILRequestFailedException - exception thrown if the request fails.

asyncChangeProperties

public MILSynchronizer asyncChangeProperties(java.lang.String interactionId,
                                             java.util.Map changedProperties,
                                             java.util.Map removedProperties)
                                      throws MILRequestFailedException
Changes interaction properties without waiting for the operation result.

Use the returned MILSynchronizer to wait for the operation result.

Parameters:
interactionId - ID of the interaction whose properties should be changed.
changedProperties - properties to be changed.
removedProperties - properties to be deleted (values are ignored).
Returns:
synchronizer for this operation.
Throws:
MILRequestFailedException - exception thrown if the request fails.