WFActivityHandler - generate(String activityId, String order,GlideDateTime startAtDspValue, Boolean noCreateFlag)

Handles pre-generation of tasks and approvals (and other objects as needed). Allows objects to be generated at the start of a workflow in a pending state and not requested until the workflow gets to the activity, thereby providing a preview of the work to be done in the future. To pre-generate objects, an activity's _generate() method is called. This method typically returns a pre-generation object that is saved in the workflow scratchpad. (For example, the object might be an array of approval ids that were generated.) When the activity runs onExecute it may request the pre-generation object and determine if the approvals have already been created in a pending state or if it needs to create the approvals in the onExecute method. Internal method _generate needs to be overridden and needs to return an object with information that it can retrieve later on when the activity's onExecute() method is called. The object must contain a duration property that contains the duration of the task(s) or approval(s) that were generated by the activity. See activity Generate for example usage.

Allows objects to be generated at the start of a workflow in a pending state and not requested until the workflow gets to the activity, thereby providing a preview of the work to be done in the future. To pre-generate objects, an activity's _generate() method is called. This method typically returns a pre-generation object that is saved in the workflow scratchpad. (For example, the object might be an array of approval ids that were generated.) When the activity runs onExecute it may request the pre-generation object and determine if the approvals have already been created in a pending state or if it needs to create the approvals in the onExecute method. Internal method _generate needs to be overridden and needs to return an object with information that it can retrieve later on when the activity's onExecute() method is called. The object must contain a duration property that contains the duration of the task(s) or approval(s) that were generated by the activity. See activity Generate for example usage.

Table 1. Parameters
Name Type Description
activityId String sys_id of this running activity (table wf_activity).
order String The order number associated with the task or approval.
startAtDspValue GlideDateTime The starting time for the task or approval
noCreateFlag Boolean
Table 2. Returns
TypeDescription
NumberThe duration property of the _generate return value is returned by this method..