call profile()

Calls the profile with name a synchronously or asynchronously. If called synchronously, the function waits for the termination of the called profile. If called asynchronously, the calling profile continues the mapping without waiting. In order to be called by this function, a profile has to be active and must have an Input Agent of type Message. Trying to call profiles with other Input Agents, inactive profiles and non-existing profiles will cause the function to return false. If parameter b is set to direct, profile a will not be called via Message and does not need to have an Input Agent of type Message.

The payload being processed by the called profile a is specified in c. It is interpreted with the encoding in d and passed on to the profile as corresponding byte stream (only if called by Message - see above). If parameter b=direct, the data is passed in the encoding of profile a.

In the case of a synchronous call of the profile, the function returns true after the successful termination of the called profile. In the case of an asynchronous call, true is returned immediately. If the call of the profile leads to an error, the error will be logged but the calling profile continues processing. The result of the function is false in that case. If parameter b=direct, a string with the converted data of the called profile is returned if that profile uses class PassBackDataResponse in one of its Responses. If any error occurs, the string will be empty.

Parameters


Parameter

Description

a

The name of the profile to be called.

b

(optional) sync for synchronous call or async for asynchronous call. Default: async.

c

Data to be passed on to the called profile.

d

(optional) Encoding for c. Default: 8859_1. Note: If you specify the value Base64 here, the value in parameter c is interpreted as Base64 encoded and sent to the profile decoded.

Examples


The following profiles are given.


Profile name

Type of Input Agent

FTP to File

Cron:Ftp

Message to FTP

Message

FTP to File2

Cron:Trigger


Parameter a

Parameter b

Parameter c

Parameter d

Call of profile successful

Result

FTP to File

sync

Data


Information not available.

"false", because the called profile does not have an Input Agent of type "Message".

FTP to File2

async

Data


Information not available.

"false", because the called profile does not have an Input Agent of type "Message".

Message to FTP

sync

Data


Yes.

true

Message to FTP

sync

Data


No.

false

Message to FTP

async

Data


Yes.

true

Message to FTP

async

Data


No.

true

Variables


  • The calling profile's job number is passed to the called profile in the system variable MSG_CALL_VAR_JOBNR. Create this variable in the called profile to access the value.

  • If an exception occurs, because the MessageService is not available, the function only return "false", but the exception message can be retrieved via the system variable MSG_CALL_VAR_SYS_EXCEPTION (if it is defined).

  • See section Passed Variables, Lists and Maps (profile chains) in general.