Mailbox Delete Service

The Mailbox Delete service deletes messages that meet specified criteria from traditional mailboxes and global mailboxes.

The following table provides an overview of the Mailbox Delete service:

Category Description
System name Mailbox Delete Service
Graphical Process Modeler (GPM) categories All Services, Internet B2B > Mailbox
Description Deletes messages in one or many mailboxes.
Business usage Use this service to delete mailbox messages that meet specific criteria. Call this service in a business process to delete messages that are no longer needed.
Usage example A business process uses the Mailbox Delete service to delete a message it has just processed and is unnecessary.
Preconfigured? Yes
Requires third-party files? No
Platform availability All supported application platforms
Related services The Mailbox Delete service works with the other application mailbox services to provide mailboxing capability:
  • Mailbox Add service – Enables the insertion of messages into a mailbox.
  • Mailbox Extract Begin service – Enables the extraction of messages from a mailbox.
  • Mailbox Extract Commit service – Provides the ability for a business process to signal application Mailbox that the message extract request has successfully completed.
  • Mailbox Extract Abort service – Enables a business process to signal a failed message extraction to application Mailbox.
  • Mailbox Query service – Enables querying messages.
  • Mailbox Evaluate All Automatic Rules service – Provides for the scheduling of automatic routing rules for application Mailbox.
  • Mailbox Evaluate Routing Rule service – Enables triggering of mailbox routing rules from a business process.
Application requirements Nothing external to application is required to use this service.
Initiates business processes? No
Invocation The business process using this service must be run by a user with permission to access all applicable mailboxes. A user with Mailbox Global Delete permission can delete any message from any mailbox.
Business process context considerations The service extracts the user permissions at run time to confirm authorization of the business process to access the referenced mailboxes.
Returned status values Returned status values:
  • Success – Normal completion.
  • User Permission Error – The user associated with the business process either does not have Mailbox Global Delete permission or does not have permission on the target mailboxes.
  • Invalid Mailbox Error – Target mailbox does not exist.
  • Invalid Mailbox Parameter Error – An error occurred passing parameters to this service such as a message ID in an invalid format.
  • Mailbox Repository Error – A generic error associated with the mailbox repository occurred.
  • Mailbox Service Error – A generic error associated with the mailbox service occurred.
Restrictions The limitations of this service are based on the assignment of mailbox permissions to users and groups. The Mailbox Delete service can be used by users assigned the Mailbox Global Delete permission.
Testing considerations Troubleshooting information for this service can be found in application Mailbox log files.

How the Mailbox Delete Service Works

Use the Mailbox Delete service to delete messages from one, many, or all mailboxes. The user ID that the business process is using must have access to the mailbox you are deleting from.

Business Process Example

The following BPML deletes all messages currently in the Acme mailbox. If the user running this business process is assigned a virtual mailbox root, then the Acme mailbox path will be relative to the users virtual mailbox root.

The user must have permission for the Acme mailbox, or the Mailbox Global Delete permission.

<process name="ACMEDelete">
    <sequence name="Delete">
   <!—Delete Messages in the Mailbox -->
       <operation name="Mailbox Delete Service">
          <participant name="MailboxDelete"/>
          <output message="DeleteRequest">
             <assign to="." from="*"></assign>
             <assign to="MessagePath">/Acme</assign>
          </output>
           <input message="inmsg">
               <assign to="DeleteResults" from="*"></assign>
          </input>
       </operation>
   </sequence> 
</process>

The following BPML deletes the message defined in the messageId parameter in the global mailbox.

The user must have appropriate permission to the global mailbox.

<process name="ACMEDelete">
    <sequence name="Delete">
   <!—Delete Messages in the Mailbox -->
       <operation name="Mailbox Delete Service">
          <participant name="MailboxDelete"/>
          <output message="DeleteRequest">
             <assign to="." from="*"></assign>
             <assign to="MessageId">38cf8cf0-1313-11e4-94d7-d531aea338c3</assign>
             <assign to="UseGlobalMailboxes">YES</assign>
          </output>
           <input message="inmsg">
               <assign to="DeleteResults" from="*"></assign>
          </input>
       </operation>
   </sequence> 
</process>

The following BPML deletes messages in multiple global mailboxes (ACME1, ACME2, and ACME3).

To delete messages from multiple global mailboxes, you must define the MailboxPath elements in process data and copy them into the operation by using the dot - star assignment in the output message, and also set the append parameter to true. The user must have appropriate permission to the global mailboxes.

<process name="ACMEDelete">
  <sequence>
    <assign to="MailboxPath" append="true">/ACME1</assign>
    <assign to="MailboxPath" append="true">/ACME2</assign>
    <assign to="MailboxPath" append="true">/ACME3</assign>
    <operation name="Mailbox Delete Service">
      <participant name="MailboxDelete"/>
      <output message="MailboxDeleteServiceTypeInputMessage">
        <assign to="." from="*"/>
        <assign to="UseGlobalMailboxes">YES</assign>
        <assign to="UserId">admin</assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"/>
      </input>
    </operation>
  </sequence>
</process>

Implementing the Mailbox Delete Service

To implement the Mailbox Delete service for use in a business process:
  1. Create a Mailbox Delete service configuration. For information, see Managing Services and Adapters.
  2. Configure the Mailbox Delete service. For information, see Configuring the Mailbox Delete Service.
  3. Use the Mailbox Delete service in a business process.

Configuring the Mailbox Delete Service

The following table describes the fields used to configure the Mailbox Delete service in the application Admin Console or GPM:

Field Description
DaysOld Number of days a message can exist in application Mailbox before being deleted. Required. Number must be 0 or greater.
EndDateTime Defines the latest allowable value for this query. Valid values are dates and times in yyyy-mm-dd hh:mm:ss format.
MailboxPath Path of the mailbox where the messages reside. If the user has been set up with a virtual root, the MailboxPath will be a relative path to the virtual root. The virtual root is not visible to the business process. Required.
MailboxSelection Mailbox paths to be queried during message deletion. Required. Valid values are:
  • All Mailboxes – Queries all mailboxes to determine messages to be deleted.
  • Selected Mailboxes – Displays a Select Mailboxes page that allows you to specify which mailboxes to query.
Restriction: Leaving this field blank causes errors in the status report.
Restriction: This parameter is not applicable for global mailboxes. You must state which mailboxes by including the MailboxPath parameter.
MessageExtractable Designates which messages to delete. Required.
  • Delete Only unextractable messages
  • Delete All messages
MessageId ID of the stored message. Optional.
MessageNamePattern Pattern that determines message selection. If a message name matches the pattern, the corresponding message is selected. Required. Valid values: Alphanumeric characters or an asterisk (*) used as a wildcard. The following characters cannot be used in a message name:
? < > | / “ %
Required format if a wildcard is used:x.y where x and y may be alphanumeric or a wildcard. Example:*.po
Restriction: You cannot specify a message name pattern composed solely of a single asterisk. It causes the adapter to fail.
StartDateTime Defines the earliest allowable value for this query. Valid values are dates and times in yyyy-mm-dd hh:mm:ss format.
UserId User ID associated with the business process.
Restriction: The user ID must have access to the mailbox that is being queried. Users who have virtual root to a submailbox in the Global Mailbox realm, can delete the messages in the parent mailbox also.
UseGlobalMailboxes Whether to delete the message from a Global Mailbox. Required. Valid values are:
  • No - The Global Mailbox is not queried to delete the specified message. The UseGlobalMailboxes parameter is displayed in the business process XML, with the value set to NO.
  • Yes - The Global Mailbox is queried to delete the specified message. The UseGlobalMailboxes parameter is displayed in the business process XML, with the value set to YES.
Tip: In addition to No and Yes, you can also select the blank selection in the Graphic Process Modeler (GPM). When you select the blank value, the Global Mailbox is not queried to delete the specified message. Also, the UseGlobalMailboxes parameter is not displayed in the business process XML.

Output from Service to Business Process

The following table contains the parameter passed from the Mailbox Delete service to a business process:

Parameter Description
MessageId ID of the stored message.