com.genesyslab.ail
Interface OutboundChain


public interface OutboundChain

Represents an outbound chain—a list of chained records associated with a contact.
If you perform actions using OutboundChain methods, it does not affect the interactions related to this OutboundChain instance. OutboundChain methods only send requests to the Outbound Server.
You are responsible for managing any interaction used to process the OutboundChain instance. To determine if there is an OutboundChain associated with an interaction, call the OutboundService.getChains() method.
According to the current campaign mode, you may have to create the interaction used to process the OutboundChain instance by calling the {link OutboundChain#createInteraction(MediaType media_type,String queue)} method.

See Also:
PlaceEventOutboundChainInfo, OutboundService, OutboundRecord

Nested Class Summary
static class OutboundChain.Reason
          Lists the possible reasons for getting an PlaceEventOutboundChainInfo event.
static class OutboundChain.TreatmentType
          Lists the possible types of treatment that exists for an outbound call.
 
Method Summary
 void addRecordToChain(OutboundRecord newRecord)
          Adds a record at the end of the chained records.
 void cancel()
          Cancels this outbound chain.
 void close()
          Closes this chain.
 Interaction createInteraction(MediaType media_type, java.lang.String queue)
          Creates a new interaction.
 Interaction createInteractionOpenMedia(java.lang.String mediaType, java.lang.String interactionType, java.lang.String interactionSubtype, java.lang.String id, java.lang.String queue, java.lang.String subject, java.util.Map userData)
          Creates a new Open Media interaction.
 void doNotCall(java.lang.String message)
          Prevents the records of this chain from being dialed by any campaign (for instance, because of contact request).
 OutboundRecord getActiveRecord()
          Returns the active record of the chain.
 java.lang.String getId()
          Returns the ID of this chain.
 java.util.Collection getInteractions()
          Returns the interactions related to this chain.
 OutboundRecord getRecord(java.lang.String recordId)
          Returns the record identified by this record ID.
 java.util.List getRecords()
          Returns the records of this outbound chain.
 OutboundChain.TreatmentType getTreatment()
          Returns the treatment data currently associated with the active record of the outbound chain.
 boolean isReadOnly()
          Returns true if this chain does not belong to an active campaign.
 boolean isScheduled()
          Returns true if the active record was created when executing a callback.
 void markProcessed()
          Sends a Mark Processed request to the Outbound Server for the active record of the outbound chain.
 void reject()
          Rejects this outbound chain.
 void requestChainedRecords()
          Requests alternative data to call the contact.
 void setActiveRecord(java.lang.String recordId)
          Marks one of the chained records as the active one.
 void setTreatment(OutboundChain.TreatmentType treatment)
          Sets the treatment type that will be associated with the active record when it is marked as having being processed.
 

Method Detail

markProcessed

void markProcessed()
                   throws RequestFailedException
Sends a Mark Processed request to the Outbound Server for the active record of the outbound chain. The active record's data are updated in the database.
Note: This method does not modify the interactions (if any) associated with the records of this chain.

Throws:
InvalidStatusException - if the active record's status is invalid.
OutboundServiceException - if an error occured in the Outbound Server.
TelephonyServiceException - if an error occurred in the T-Server.
RequestFailedException - if the request fails for other reasons.

reject

void reject()
            throws RequestFailedException
Rejects this outbound chain. The system should send this chain or its active record to another agent.
Note: This method does not modify the interactions (if any) associated with the records of this chain.

Throws:
InvalidStatusException - if the active record's status is invalid.
OutboundServiceException - if an error occurred in the Outbound Server.
TelephonyServiceException - if an error occurred in the T-Server.
RequestFailedException - if the request fails for other reasons.

cancel

void cancel()
            throws RequestFailedException
Cancels this outbound chain. An agent may decide, because of the contact's history or record data, that this contact does not need any call. As a result of this method call, the current campaign no longer handles with the records of this chain.
Note: This method does not modify the interaction (if any) associated with the records of this chain.

Throws:
InvalidStatusException - if the active record's status is invalid.
OutboundServiceException - if an error occurred in the Outbound Server.
TelephonyServiceException - if an error occurred in the T-Server.
RequestFailedException - if the request fails for other reasons.

doNotCall

void doNotCall(java.lang.String message)
               throws RequestFailedException
Prevents the records of this chain from being dialed by any campaign (for instance, because of contact request).
Note: This method does not modify the interaction (if any) associated with the records of this chain.

Parameters:
message - a message to be written in the Do Not Call dedicated log.
Throws:
InvalidStatusException - if the active record's status is invalid.
OutboundServiceException - if an error occurred in the Outbound Server.
TelephonyServiceException - if an error occurred in the T-Server.
RequestFailedException - if the request fails for other reasons.

addRecordToChain

void addRecordToChain(OutboundRecord newRecord)
                      throws RequestFailedException
Adds a record at the end of the chained records.
You can create a new record by calling the OutboundRecord.clone(java.lang.String). Note that the new record won't be returned by calling the getRecords() method because it was only added to the calling list on the server side. To update this chain so that it takes the new record into account, you can call the requestChainedRecords() method.

Throws:
InvalidStatusException - if the active record's status is invalid.
OutboundServiceException - if an error occurred in the Outbound Server.
TelephonyServiceException - if an error occurred in the T-Server.
RequestFailedException - if the request fails for other reasons.

requestChainedRecords

void requestChainedRecords()
                           throws RequestFailedException
Requests alternative data to call the contact. You can call this method when the active record number could not be dialed, or to retrieve records newly added to this chain.

Throws:
InvalidStatusException - if the active record's status is invalid.
OutboundServiceException - if an error occurred in the Outbound Server.
TelephonyServiceException - if an error occurred in the T-Server.
RequestFailedException - if the request fails for other reasons.

getRecords

java.util.List getRecords()
Returns the records of this outbound chain. The number of records can change along the life cycle of the chain processing, which has one record at the initialization ('initial record'), and at least one record after calling the requestChainedRecords() method.

Returns:
a list of OutboundRecord.

isScheduled

boolean isScheduled()
Returns true if the active record was created when executing a callback.


setTreatment

void setTreatment(OutboundChain.TreatmentType treatment)
Sets the treatment type that will be associated with the active record when it is marked as having being processed.

Parameters:
treatment - the treatment type.

getTreatment

OutboundChain.TreatmentType getTreatment()
Returns the treatment data currently associated with the active record of the outbound chain.


setActiveRecord

void setActiveRecord(java.lang.String recordId)
                     throws RequestFailedException
Marks one of the chained records as the active one. You can then retrieve it by calling the getActiveRecord() method.

Parameters:
recordId - ID of a record (can be retrieved by calling the IdObject.getId() method).
Throws:
InvalidStatusException - if the active record's status is invalid.
OutboundServiceException - if an error occurred in the Outbound Server.
TelephonyServiceException - if an error occurred in the T-Server.
RequestFailedException - if the request fails for other reasons.

getActiveRecord

OutboundRecord getActiveRecord()
Returns the active record of the chain.


getRecord

OutboundRecord getRecord(java.lang.String recordId)
Returns the record identified by this record ID.

Parameters:
recordId - Unique ID of a record (can be retrieved by calling the IdObject.getId() method.)

createInteraction

Interaction createInteraction(MediaType media_type,
                              java.lang.String queue)
                              throws RequestFailedException
Creates a new interaction.

Throws:
RequestFailedException

createInteractionOpenMedia

Interaction createInteractionOpenMedia(java.lang.String mediaType,
                                       java.lang.String interactionType,
                                       java.lang.String interactionSubtype,
                                       java.lang.String id,
                                       java.lang.String queue,
                                       java.lang.String subject,
                                       java.util.Map userData)
                                       throws RequestFailedException
Creates a new Open Media interaction.

AIL tests the specified media type. If AIL is connected to UCS (Universal Contact Server), it checks whether the mediaType belongs to the value list of the multimedia/open-media-saved-list option of your application's configuration template. If this is true, AIL saves the created open media interaction in UCS.

If the ID is null, and if UCS is connected, UCS creates an interaction ID for this new interaction. Otherwise, AIL creates a random ID.

Note: You cannot use predefined Genesys media types (email or chat) to create your open media interaction.

Parameters:
mediaType - a media type defined in the "Business Attributes/Media Type" section of the Configuration Layer. Do not use email or chat values.
interactionType - an interaction type defined in the "Business Attributes/Interaction Type" section of the Configuration Layer.
interactionSubtype - an interaction subtype defined in the "Business Attributes/Interaction Subtype" values.
id - the customer interaction ID when the interaction is received from a customer server, not a Genesys server.
queue - the queue to which the interaction will be submitted.
subject - the interaction subject.
userData - the customer data or useful additional data. Can be null.
Returns:
the new interaction.
Throws:
RequestFailedException

close

void close()
Closes this chain.


getInteractions

java.util.Collection getInteractions()
Returns the interactions related to this chain.


isReadOnly

boolean isReadOnly()
Returns true if this chain does not belong to an active campaign. Typically occurs when an outbound-related interaction is transferred to an agent who does not belong to the campaign.


getId

java.lang.String getId()
Returns the ID of this chain.