Scripts (SCRI)
Script objects allow you to write and reuse code containing internal processing instructions. The code you write in Script objects is executed directly in the Automation Engine and not on target systems. You use the Automation Engine scripting language in Script objects. You cannot use Job Control Language (JCL) lines.
You can write your code from scratch and you can use Automic Automation’s Gen AI capabilities to:
-
Generate code
Describe what you want a script to do in natural language and have the assistant draft the code for you.
-
Analyze and summarize
Get plain-language explanations of complex scripts or specific code elements.
-
Troubleshoot
Identify errors or potential logic issues and receive suggestions for improvements or fixes.
For more information, see Generating and Analyzing Code Using AI.
Execution and Behavior
Executable objects go through various execution stages (see Executing Objects). Although Script objects are executable objects, they do not go through the Processing stage. They end after they have been generated and their status changes to Finished during runtime. For this reason, their behavior is slightly different to that of other executable objects. For more information, see Executing Objects: The Processing Stage.
Tip: Use Include objects within your Scripts to reuse common code blocks and ensure consistency across your objects. For more information, see Includes (JOBI).
Object class: Executable object
Object type/Short name: SCRI
Defining Script Objects
-
In the Process Assembly perspective click Add Object. On the Add Object dialog, select Script (SCRI). For information on how to add objects, see Adding Objects.
A Script object definition is made up of the following pages:
-
Standard pages that are always available, no matter what type of object you are defining:
-
Additional pages that are always available for executable objects:
-
On the Object Name dialog enter the name of the new object. Choose it carefully. For more information, see Best Practices: Naming Conventions for Objects.
-
Write your script on the Process page. You can write it from scratch or you can leverage Automic Automation's Gen AI capabilities for it. For more information, see Generating and Analyzing Code Using AI.
Executing Script Objects
For all executable objects except Scripts, the following two checks take place after the object has been generated (see Executing Objects: The Generation Stage):
- Sync object dependencies
- Maximum number of simultaneous tasks that are allowed
Since Script objects do not have a processing stage and end immediately after generation, only the script itself can be synchronized. For this reason, in Scripts these checks take place before generation, also if you select the Generate Task at: Runtime option.
Script objects can be included in Schedules (JSCH) and thus be executed automatically at predefined dates or intervals. Likewise, they can be part of Workflows (JOBP). For more information, see Superordinate Tasks (Parents).
Restarting Scripts
When you restart a Script object, it is always generated at activation time. For more information about the Generate Task at: Runtime/Activation time options, see Executing Objects: Generating Task at Activation Time vs Generating Task at Runtime.
See also:
{"URL":["/*.*/awa/pa_view_SCRI"],"heroDescriptionIdentifier":"ice_SCRI_intro","customCards":[{"id":"ice_ExecutingSCRIs","title":"Executing Script Objects","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/AWA/Objects/obj_script.htm","languages":["en-us"]},{"id":"ice_ScriptVIDEO","title":"Watch the Video: Scripting and Script Objects","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/AWA/Objects/obj_Script_Video.htm","languages":["en-us"]},{"id":"ice_GenerateAnalyzeCode_AI","title":"Generating and Analyzing Code Using AI","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides//Content/_GenAI/.GenAI_GenerateandAnalyzeCode.htm","languages":["en-us"]},{"id":"ice_ExecutingObjects","title":"Executing Objects","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/AWA/Executions/obj_Executing_overview.htm","languages":["en-us"]},{"id":"ice_scripting_and_the_ae_scripting_language","title":"The Automation Engine Scripting Language","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Writing/AE_Scripting_Language.htm","languages":["en-us"]},{"id":"ice_script_processing","title":"Script Processing","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Writing/Script_Processing_Order.htm","languages":["en-us"]},{"id":"ice_writing_scripts","title":"Writing Scripts","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Writing/Script_Writing.htm","languages":["en-us"]},{"id":"ice_working_with_script_editor","title":"Working with the Script Editor","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Writing/obj_Wkg_ScriptEditor.htm","languages":["en-us"]},{"id":"ice_arithmetic_calculations_in_scripts","title":"Calculations","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Writing/Script_Arithmetics.htm","languages":["en-us"]},{"id":"ice_script_elements_for_editing_strings","title":"Editing Strings","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Reference/Overview/Strings_Script.htm","languages":["en-us"]},{"id":"ice_error_handling_in_scripts","title":"Error Handling","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Writing/Script_Error_Handling.htm","languages":["en-us"]},{"id":"ice_reusing_script_components","title":"Reusing Scripts","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Writing/Script_Reuse.htm","languages":["en-us"]},{"id":"ice_ae_script_reference","title":"Automation Engine Script Reference","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/Script/Reference.htm","languages":["en-us"]},{"id":"ice_working_with_objects","title":"Working with Objects","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/AWA/Objects/obj_WorkingWithOverview.htm","languages":["en-us"]},{"id":"ice_AWIs_CommonFunctions","title":"Common Functions","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/_Common/CommonFunctions/CF_OverviewOfChapter.htm","languages":["en-us"]},{"id":"ice_UnderstandingPA","title":"Understanding the Process Assembly Perspective","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/AWA/Objects/ProcessAssembly.htm","languages":["en-us"]},{"id":"ice_Overview_AWI","title":"Understanding the User Interface","type":"customize","url":"https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/*.*/Automic%20Automation%20Guides/Content/_Common/GettingStarted/GS_OverviewAWI.htm","languages":["en-us"]}]}