In jobs that receive AS2 messages, you can call this function in order to obtain the name of the sending AS2 partner. This is the AS2 name defined under "Partner Settings" in the AS2 partner configuration page. To extract the AS2 partner name, add an execution step that calls either the /system/compute-string or /system/compute built-in functions, and enter the following expression:
where partner is the name of the input parameter of type AS2 partner.
An input parameter of type AS2 partner is added to the job configuration page automatically, when you select the check box Make this job available via HTTP at URL...and choose AS2 service. For more information about such jobs, see Receiving AS2 messages.
as2-partner-remote-name(partner:AS2 Partner) -> string
Specifies the object of type AS2 Partner from which the remote name should be extracted.
The job illustrated below gets the name of the sending AS2 partner. This job is a slightly more complex variant of the example described in Receiving AS2 messages.
The job shown above has two input parameters, one of which is the AS partner object. The job consists of three execution steps:
•The first step saves the AS2 message to a file and returns.
•The second job extracts the name of the AS2 partner from the partner input parameter, with the help of the as2-partner-remote-name function.
•The third job sends an email that informs the recipient firstname.lastname@example.org that a new AS2 message was received from the partner name computed previously.
Note how the second and the third step are enclosed into a "Postpone" block. This was done in order not to delay or hinder in any way the delivery of the Message Disposition Notification (MDN) to the sending partner. First, the job executes the non-postponed step 1 (that is, saving the AS2 message). Next, it returns the result (MDN) to the sending partner, and only then proceeds to executing postponed steps 2 and 3. In the event that steps 2 and 3 fail for whatever reason, the issue can be dealt with later locally, but it does not affect the response sent to the AS2 partner.
For more information about postponed execution, see Postponed steps.