Script with an action launch point
An action launch point associates a script with an action and executes when the specified action occurs. Use the Actions application to configure the associated action.
You can create actions to perform the following tasks:
- Start an application action
- Execute a custom class or specified executable program
- Set the value of a field on a record
To create a script with an action launch point, in the Automation Scripts application, select the Action field, but you can modify it. For example, you can specify the name of an existing action that you intend to use. If you create a new action name, you can use that name when you create the action in the Actions application. Specify the object that can launch this script.action. When you specify a name for the launch point, the value is copied to the
Example of an action launch pointYou can use an action launch point to automate tasks that are part of a workflow. When a service request record is worked on as part of a workflow process, the target contact and target start dates must be calculated. A work log entry must also be created for the service request.
- Define an action launch point on the service request object process.
- Define the script that calculates the target contact and start dates, and generates the work
from java.util import Calendar if status=='NEW' and reportedpriority==1 and assetnum is not None: cal=Calendar.getInstance() cal.add(Calendar.DATE, +1) targetcontactdate = cal.getTime() cal.add(Calendar.DATE,+1) targetstartdate=cal.getTime() worklogset = mbo.getMboSet ('WORKLOG') worklogentry = worklogset.add() worklogentry.setValue('clientviewable',1) worklogentry.setValue('logtype','WORK') worklogentry.setValue('description','System initiated processing')
- Define the workflow process and associate the action that executes the action launch point with the workflow process. Validate, enable, and activate the workflow.
- Test the workflow process, action launch point, and script and activate or de-activate the launch point as required.