JavaScript Popping - QueuedIf the order in which a series of activities are completed is important, then the activities should be queued. When queued, each Workflow and activity will only be created as it reaches the front of the queue, so there is no other in-progress Activity that can be switched to by the agent as there is with immediate popping.
Unlike a URL pop or immediate JavaScript pop, the current activity and all Workflows queued within it will be completed before any new activity is then popped. For example, this could be used to queue a payment or survey Workflow within the current activity for completion once the current Workflow is completed, and then queue a subsequent activity for a new record once the Workflows relating to the current activity have been completed.
Important: This article covers two near-identical functions. However, it should be noted that the Desktop.Queue.QueueCampaignByName() function is intended for use by a plugin rather than in a Workflow run, and cannot be used from within a Workflow run as other Helper Functions can be. It is documented here for completeness, but this article will focus primarily on the use of Script.Queue.QueueCampaignByName() instead, which can be used from within a Workflow run.
How ToThe syntax for queueing via JavaScript is:
Script.Queue.QueueCampaignByName(newActivity, identifier, reference, restartScript, data, connector, connectorType);
or
Desktop.Queue.QueueCampaignByName(true, identifier, reference, restartScript, data, connector, connectorType);
The available parameters for both functions are:
Example for SQL Plugin:
Script.Queue.QueueCampaignByName(true, "tbl_CustomerData", "4074", true);
Example for Integration - Generic:
This then queues our Workflow, and will populate the values "Joe Bloggs" and "01234 567890" into [var_csCallerName] and the linked Workflow field of the queued Workflow.
NotesIf the function is being invoked from an external website that Scripting is running within, and the external website and Scripting are on different domains, then domain spoofing will need to be utilised to allow this to work.
Upon exiting all JavaScript-queued Workflows, the agent will be returned to the Desktop.
|