In this article:

Notify by Email

Example of Unit to Set Up Dynamic Recipient List

Calling Event

Additional Parameters of Result Handling for Regular Report

Publish to FTP server

Print

File Format and Export Options

Setting Up Handling of Task Execution Result

To set up task execution result handling options, use the Result page/tab in the task setup wizard.

To open the task setup wizard

The following result handling options are available for all tasks:

The following additional result handling options are available for regular report calculation task:

NOTE. For the report sent by email and/or published to an FTP server the following formats are available: XLSX, XLS, PDF, PNG in the web application; XLSX, XLS, PDF, RTF, HTM, ODS, EMF, PPREPORT in the desktop application.

Notify by Email

Sending notifications by email is available only for tasks executed by schedule. When tasks are started manually, messages are not sent.

To set up automatic sending of email notification about task execution, select the Notify by Email checkbox and select the option for adding recipients:

NOTE. The list shows only functions with the signature: Function <name>(<param>: IScheduledTask): IArrayList.

To set up email parameters:

After executing the task the notification with specified parameters of email is sent to specified addresses. Notification sending state will be displayed in the container workspace in the Notification column.

IMPORTANT. On setting up email sending the configuration file must contain description of the <HOST> section, otherwise emails will not be sent.

Example of Unit to Set Up Dynamic Recipient List

To execute the example, add links to the Collection, Metabase system assemblies.

Public Function GetRecepients(Task: IScheduledTask):IArrayList;
Var
    List: IArrayList;
    Mb: IMetabase;
    MS: IMetabaseSecurity;
    SSS: ISecuritySubjects;
    SS: ISecuritySubject;
Begin
    Mb := Metabaseclass.Active;
    MS := MB.Security;
    SSS := MS.AllUsers;
    // Platform user:
    SS := SSS.Item(9);
    Select Case (Task.State As Integer)
        // Task is executed successfully:
        Case 3:
            List := New ArrayList.Create;
            List.Add("user1@example.com");
            List.Add(MS.ResolveSid(SS.Sid));
        // Task is executed with error:
        Case 4:
            List := New ArrayList.Create;
            List.Add("user2@example.com");
            List.Add(MS.ResolveSid(SS.Sid));
    End Select;
    Return List;
End Function GetRecepients;

Determine created module in the Module field on the Result tab in the task parameters setting dialog box. Enter GetRecepients in the Function box.

After executing the example, the email to send task execution notification will be determined depending on the current state of executed task.

Calling Event

To set up custom event call after the task calculation, execute the following operations.

  1. Go to the Events and Export page:

  1. In the Call Event drop-down list select the event determined on the Custom Metadata > Events tab in repository parameter settings.

  1. Select the Call Event checkbox on the Result tab.

  2. In the drop-down list select the event determined on the Custom Metadata > Events tab in repository parameter settings.

After task execution a specified custom event is generated. This event will be handled by the tasks with configured execution after custom event.

Additional Parameters of Result Handling for Regular Report

Additional parameters of result handling are available for the Regular Report Calculation task:

Publish to FTP server

Task calculation result can be published to FTP server. To do this:

  1. Select the Publish to FTP Server checkbox. It is available only in the desktop application.

  2. Set server address in the input field.

  3. Set file format and export options.

After task execution the report calculation result is published to the specified server.

IMPORTANT. On setting up saving files to FTP server, the configuration file must contain description of the <FTP> section, otherwise the report file is not saved to server.

Print

To print task execution result:

  1. Select the Print checkbox. It is available only in the desktop application.

  2. Specify a printer in the following format: server\printer.

File Format and Export Options

File format and export options can be specified for a report attached to a message and/or published to FTP server:

  1. Select report format in the File Format drop-down list:

  1. To set up options for report export to the selected format, click the Export Options button. The Export Options dialog box opens. The dialog box appearance depends on the selected report export format.

After task execution the report calculation result is exported to the specified format.

See also:

Creating Scheduled Tasks