Mailbox Delete Mailbox Service

The Mailbox Delete Mailbox service deletes one or multiple mailboxes, plus the submailboxes, messages, virtual roots, routing rules, and permissions. This service completely and permanently removes mailboxes and everything associated with the deleted mailboxes.

Remember: There is a separate but similarly named service called the Mailbox Delete service that deletes only messages in mailboxes.

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

Category

Description

System Name

Mailbox Delete Mailbox Service

Graphical Process Modeler (GPM) categories)

Internet B2B, Mailbox

Description

This service deletes one or multiple mailboxes.

Business usage

A business user uses this service to delete mailboxes that meet specific criteria.

Usage example

Dolnet currently has 100 trading partners defined in the Sterling B2B Integrator system that exchange data with the company. Each trading partner has its own mailbox and unique way of transferring data. Dolnet has decided to stop any further transactions with one of the trading partners, Vialore, and must now modify Sterling B2B Integrator such that Vialore can no longer exchange data with Dolnet. As part of this change, the Vialore mailbox must be deleted. The Mailbox Delete Mailbox service is used in a business process to delete the Vialore mailbox.

Preconfigured?

No

Requires third-party files?

No third-party files are required.

Platform availability

All supported Sterling B2B Integrator platforms

Related services

This service also works with the other Mailbox services to provide a mailbox capability to Sterling B2B Integrator. The related services are:
  • 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 – Enables a business process to notify the mailbox system that the message extract request has successfully completed.
  • Mailbox Extract Abort service – Enables a business process to notify the Mailbox service of a failed message extraction.
  • Mailbox Query service – Queries messages.
  • Mailbox Delete service – Deletes messages.
  • Mailbox Update service – Updates messages.
  • Mailbox Evaluate All Automatic Rules service – Schedules automatic routing rules for the Mailbox system.
  • Mailbox Evaluate Routing – Applies mailbox routing rules from a business process.

Application requirements

Nothing external to Sterling B2B Integrator is required for the use of this service.

Initiates business processes?

No

Invocation

A user with the Mailbox Global Delete permission (obtained through the addition to a User Account or Group through the Accounts page) must execute the business process invoking this service.

Business process context considerations

The Mailbox Global Delete permission ensures that the business process is authorized to access the referenced mailboxes.

Returned status values

Possible status values that can be returned from this service are:
  • Success – Normal execution with the return parameters specified later in this section.
  • User Permission Error – The user associated with the business process does not have Mailbox Global Delete permission.
  • Invalid Mailbox Error – The mailbox identified as the delete target does not exist.
  • Invalid Mailbox Parameter Error – An error has been made in the passing of parameters to use this service, possibly a malformed date or numeric value.
  • Mailbox Repository Error – A generic error associated with the mailbox repository has occurred.
  • Mailbox Service Error – A generic error associated with the Mailbox service has occurred.

Restrictions

The limitations of this service are based on the assignment of the Mailbox Global Delete permission.

Testing considerations

Debug information for this service can be found in the mailbox log files.

How the Mailbox Delete Mailbox Service Works

  1. Starting with the originally passed list of mailboxes to delete, the Mailbox Delete Mailbox service recursively adds each underlying submailbox until every mailbox in the hierarchy is represented.
  2. Then for each mailbox, the service deletes all contained messages, the permission, all of the permission associations to users or groups, virtual roots, routing rules, and the mailbox itself.
  3. If there are multiple mailboxes in the routing rule, the deleted mailbox is removed from the rule, otherwise the rule will be deleted.
  4. All operations are performed together as a group, all or nothing. If any part fails, no changes are made by the service and an error is returned.

Implementing the Mailbox Delete Mailbox Service

To implement the Mailbox Delete Mailbox service, complete the following tasks:
  1. Obtain Mailbox Global Delete permission, through the addition to a User Account or Group in the Accounts page.
  2. Create a configuration of the Mailbox Delete Mailbox service. For basic information about creating service configurations, see Managing Services and Adapters. For information about the fields specific to this service, see Configuring the Mailbox Delete Mailbox Service.
  3. Add the provided Mailbox Delete Mailbox service configuration to a business process.
  4. Test and run the business process.
    Note: A preconfigured Mailbox Delete Mailbox service is also provided.

Configuring the Mailbox Delete Mailbox Service

You must specify field settings in the Admin Console and the Graphical Process Modeler.

Creating a Service Configuration in the Admin Console

Use the field definitions in the following table to set up the configuration provided with Sterling B2B Integrator.

Field Description

Name

Unique and meaningful name for the service configuration. Required.

Description

Meaningful description for the service configuration, for reference purposes. Required

.

Select a Group

Select one of the options:
  • None – Do not include the configuration in a service group at this time.
  • Create New Group – Enter a unique name for a new group, which will be created with this configuration. (You can then add other services to the group as well.)
  • Select Group – If service groups already exist for this service type, they are displayed in the list. Select a group from the list.
Tip: For more information about service groups, see Managing Services and Adapters.

Defining the Service in the GPM

Use the field definitions in the following table to set up the service configuration in the GPM:

Parameter

Description

Force

Whether a mailbox delete should be forced when the mailbox contains submailboxes or messages. Optional. Valid values are:
  • Yes – Mailbox is deleted even if it has messages or submailboxes.
  • No – Mailbox is not deleted if it has messages or submailboxes. (Default)

MailboxPath

Mailbox path that you would like to delete. If you have a virtual root, then MailboxPath is a relative path to the virtual root. The virtual root is not visible to the business process. Valid value is a UNIX path where the folders correspond to a mailbox hierarchy. The path must begin with the / character and use the / to delimit mailboxes in the hierarchy. The space character is permitted in the middle of a mailbox name, and the following characters are not permitted in a mailbox name:
? < > | “ : \ / % *

If the mailbox that you are deleting is a Global Mailbox, set UseGlobalMailboxes = Yes.

Tip: This element can be repeated to delete multiple mailboxes.

UserId

Do not use.
Restriction: The UserId parameter has no effect on this service and is unsupported. The service always uses the user ID that is running the business process.

UseGlobalMailboxes

Whether to use only Global Mailbox or only traditional Sterling B2B Integrator mailboxes. The following values are valid:
  • Yes - The Global Mailbox is used. The UseGlobalMailboxes parameter is displayed in the business process XML, with the value set to YES.
  • No (default) - The Global Mailbox is not used. The UseGlobalMailboxes parameter is displayed in the business process XML, with the value set to NO.

Business Process Examples

The following example shows how the Mailbox Delete Mailbox service can be used in a business process.

Business Scenario

Dolnet currently has 100 trading partners defined in the Sterling B2B Integrator system that exchange data with the company. Each trading partner has its own mailbox and unique way of transferring data. Dolnet has decided to stop any further transactions with one of the trading partners, Vialore, and must now modify Sterling B2B Integrator such that Vialore can no longer exchange data with Dolnet. As part of this change, the mailbox for Vialore must be deleted. The Mailbox Delete Mailbox service is used in a business process to delete the Vialore mailbox.

This is the BPML for the business process:

<process name="MailboxDeleteMailboxProcess">
  <sequence name="MailboxDeleteMailboxSequence">
    <operation name="Mailbox Delete Mailbox Service">
     <participant name="MailboxDeleteMailbox"/>
     <output message="DeleteRequest">
       <assign to="MailboxPath">/VialoreMailbox</assign>
       <assign to="Force">Yes</assign>
       <assign to="." from="*"></assign>
     </output>
      <input message="DeleteResponse">
       <assign to="DeleteResponse" from="*"></assign>
     </input>
    </operation>
 </sequence> 
</process>

Business process for Global Mailbox

This is the BPML for the business process when the mailbox that will be deleted is a Global Mailbox:

<process name="MailboxDeleteMailboxProcess"> 
  <sequence name="MailboxDeleteMailboxSequence">      
     <operation name="Mailbox Delete Mailbox Service"> 
       <participant name="MailboxDeleteMailbox"/> 
       <output message="DeleteRequest">     
          <assign to="MailboxPath">/Vialore1</assign> 
          <assign to="MailboxPath">/Vialore2</assign> 
          <assign to="Force">yes</assign> 
          <assign to="UseGlobalMailboxes">yes</assign> 
          <assign to="." from="*"></assign> 
      </output> 
        <input message="DeleteResponse"> 
           <assign to="DeleteResponse" from="*"></assign>
     </input>
    </operation>
  </sequence> 
</process>

Parameters Passed From Service to Business Process

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

Parameter

Description

DeleteResponse

Specifies all resources deleted as a result of operation of the service, including mailboxes, submailboxes, messages, permissions, virtual roots, and routing rules.

Following is an example of DeleteResponse in the process data:

<?xml version="1.0" encoding="UTF-8"?> 
<ProcessData>
 <DeleteResponse>
    <Mailbox>
     <MailboxId>11</MailboxId>
     <MailboxPath>/MyMailbox</MailboxPath>
   </Mailbox>
    <Mailbox>
     <MailboxId>12</MailboxId>
     <MailboxPath>/MyMailbox/MyMailboxSub</MailboxPath>
   </Mailbox>
    <Message>
     <MessageId>9</MessageId>
      <MessageName>delta.txt</MessageName>
   </Message>
    <Message>
     <MessageId>10</MessageId>
     <MessageName>delta2.txt</MessageName>
   </Message>
    <Permission>
     <PermissionName>/MyMailbox.mbx</PermissionName>
   </Permission>
    <Permission>
     <PermissionName>/MyMailbox/MyMailboxSub.mbx</PermissionName>
   </Permission>
    <Rule>
     <RuleId>4f06da5c:1057842a730:2327</RuleId>
   </Rule>
    <VirtualRoot>
     <UserId>jane_doe</UserId>
    </VirtualRoot>
 </DeleteResponse> 
</ProcessData>