Specifying mail recipients

Multiple recipients

In the actors and to fields, multiple recipients can be separated with a semi colon (;) or a colon (:).

Sending Mails to a BCC target

Sometimes you want to send emails to a BCC target in addition to the normal receipient. Currently, there are two supported ways of doing that: First you can specify an bccActors or bcc attribute (according to actors and to) in the process definition.

<mail to='#{initiator}' bcc='bcc@mycompany.com' subject='websale' text='your websale of #{quantity} #{item} was approved' />

The second way is to always send an BCC Mail to some location you can configure in the central configuration (jbpm.cfg.xml) in a property:

<jbpm-configuration>
  ...
  <string name="jbpm.mail.bcc.address" value="bcc@mycompany.com" />
</jbpm-configuration>

Address resolving

In all of jBPM, actors are referenced by actorId's. This is a string that servers as the identifier of the process participant. An address resolver translates actorId's into email addresses.

Use the attribute actors in case you want to apply address resolving and use the attribute to in case you are specifying email addresses directly and don't want to apply address resolving.

An address resolver should implement the following interface:

public interface AddressResolver extends Serializable {
  Object resolveAddress(String actorId);
}

An address resolver should return 1 of 3 types: a String, a Collection of Strings or an array of Strings. All strings should represent email addresses for the given actorId.

The address resolver implementation should be a bean configured in the jbpm.cfg.xml with name jbpm.mail.address.resolver like this:

<jbpm-configuration>
  ...
  <bean name='jbpm.mail.address.resolver' class='org.jbpm.identity.mail.IdentityAddressResolver' singleton='true' />
</jbpm-configuration>
      

The identity component of jBPM includes an address resolver. That address resolver will look for the User of the given actorId. If the user exists, the user's email is returned, otherwise null. More on the identity component can be found in the section called “The identity component”.