Usage

schedule(expression[, title])

Description
Allows the user to insert a script snippet into the import queue for later execution. Useful in situations where a script should run after a long-running import job, or if the script should run in a separate transaction that is independent of the calling transaction.

The title parameter is optional and is displayed in structr-ui in the Importer section and in the notification messages when a script is started or finished.

Example

${schedule('call("myCleanupScript")', 'Cleans unconnected nodes from the graph')}

JavaScript Example

{
    Structr.schedule(function() {
        // execute global method
        Structr.call('myCleanupScript');
    }, 'Cleans unconnected nodes from the graph');
}

Graph-Browser

About this article
Last change 2018-07-02
Topics