Running order guides automatically
-
- UpdatedJan 30, 2025
- 4 minutes to read
- Yokohama
- Building applications
Service catalog order guides allow customers to make a single service catalog request that can generate several ordered items. Administrators can configure order guides to run automatically, from a workflow or a script to generate a set of ordered items without manually submitting a service catalog request. Administrators can also review and reprocess the order guide failures.
As a use case, an onboarding workflow for a new employee can run an order guide to automatically order items for that employee.
Running order guides from scripts
Running order guides with a server-side script is more complex than using workflows, but it allows more flexibility and can be used in non-workflow situations.
Use the SNC.ScriptableOrderGuide Java class to run order guides with a script.
Use the SNC.ScriptableOrderGuide(String orderGuideId) constructor to create a new ScriptableOrderGuide object.
Method summary
Script example
Running order guides from workflows
Running an order guide from a workflow is suitable if you include order guides as part of a broader workflow-based process.
Field | Description |
---|---|
Order Guide | The name of the order guide that this activity processes. For example, Example Employee Onboarding IT. |
Script | A script passing information to the order guide. This information is sent as
a JSON encoded string parameter assigned to the answer
variable. The script must meet these requirements:
|
Results
- Success: the activity successfully processed the order guide. This does not mean a request was created. If a request was created, the request sys_id is added to the workflow scratchpad under the sc_request variable.
- Failure: while processing the order guide a failure occurred, creating a failure record. If the processing fails, you can view and edit the failure record.
Workflow example
The Example Employee Onboarding IT Workflow workflow uses this example to generate IT catalog items for a new employee as part of an onboarding process.
- Take a JSON string generated previously from the HR change record.
- Append the mandatory opened_by and requested_for parameters to that string.
- Submit the new string for processing by the order guide.
View order guide failures
Order guide processing can fail, for example if the order guide being run does not exist. When a failure occurs during the order guide processing, the Scriptable Order Guide Failures submodule allows you to review and reprocess the failures. A record is created for each failure and once you fix the errors that caused the initial failure, you can reprocess the failed order guides.
About this task
If a failure occurs, a failure record is created in the Scriptable Order Guide Failures [sc_script_order_guide_failure] table.
To view details of a failure, navigate to
, then open a failure record.Reprocessing failures: If you have fixed the error that caused the initial failure, you can reprocess failed order guides.
Procedure