trigger profile()

This function calls the profile with name a. In order to be called by this function, a profile must be active and have a time-driven Input Agent and schedule type "Trigger". Calling profiles with other Input Agents, inactive profiles and non-exiting profiles will cause the function to return "false".

The available call modes in b are "sync", "async" and "direct". In the synchronous case, the system waits for the end of the profile run, in the asynchronous case it continues with its own processing, without waiting for the termination of the triggered profile.

After the successful call of the profile, the function returns "true". If an asynchronous call is performed, true is returned immediately. If the call of the profile is leading 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 mode "direct" is used, the return value (in UTF-8) is supplied by the called profile (resp. by the first job, if several jobs get created), which has to use the class PassBackDataResponse in a Response.

Note: An error email will be sent if the triggered profile is set to "sync" and is already running! Solution: Either set parameter b to "async" or allow parallel processing for the triggered profile (deactivate option "Profile may only run in one instance").

Parameters


Parameter

Description

a

Name of the profile to be called.

b

(optional) Call mode. Allowed values: "sync", "async", "direct". Default: "async".

Examples


The following profiles are defined.


Profile name

Type of Input Agent

FTP to File

Cron:Ftp

Message to FTP

Message

FTP to File2

Cron:Trigger

FTP to File3

Cron:Trigger


Parameter a

Parameter b

Call of profile successful

Result

FTP to File

sync

Was not called.

false, because the called time-driven profile is not of subtype Trigger.

Message to FTP

sync

Was not called.

false, because the called profile is not time-driven.

FTP to File2

async

Yes.

true

FTP to File2

sync

No.

false

FTP to File2

async

No.

true

FTP to File3

direct

Yes.

<Return value of called profile>

Variables


  • The calling profile's job number is passed to the called profile in the system variable with the name 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.