A job preset is an XML script stored in the presets table. It is executed in anExecuteaction as the first action of the job:
From the command line option:-pj (e.g.sapio365.exe -j "MainFrame/051-sharedFilesByType.xml"-pj"MainFrame/051-sharedFilesByType-1.xml"")
By double-clicking it in the Job Center Configuration.
With -pj or from double-click, the preset is loaded as an Execute action and run before all actions from the job (same as -px with -x).
Detailed Description
Presets can be:
1. Imported
An imported preset is a regular automation script from an XML file. It is validated upon import, just like a regular script. It can be any type of script.
2. Generated by the application
A generated preset is made from the content of the selected job.
The generation process analyzes the actions in the selected job and processesUserInputactions only.
It recursively loads jobs inExecuteactions and processes theirUserInputs. The UserInput may be inside or outside a PreparePreset block.
For eachUserInput,the process pops up the corresponding dialog and records the entered values asSetVaractions. See the example below...
When a UserInput should be ignored during a preset, set the attribute IgnoreInPreset to "True".
Example - MsgBox job is:
XML
<ytriaAutomation Application="sapio365">
<UserInput>
<Variable name="Tutorial" value="Documentation" Label="Tutorial is" Tooltip="This is a tooltip" Type="Text"/>
<Variable name="Information" value="www.ytria.com" Label="Information" Tooltip="THE DOC" Type="Text"/>
</UserInput>
<MsgBox Title="The documentation is available" Message="Tutorial is {%Tutorial%}" MessageExtended="{%Information%}" Type="eXclamation"/>
</ytriaAutomation>
When executed without a preset, the application pops-up the UserInput dialog:
In order not to interrupt the job execution (for example when a scheduled task is created, we do not want the script to wait for human input), a preset is created to feed the variables set by theUserInputdialog.
There is one SetVar per Variable set in the original script UserInputactions. A single UsePreset action is added to shut down theUserInput at run time. UsePreset is a toggle. When set to FALSE, UserInput is brought back from the dead and interrupts the execution again.
Preset generation only:
PreparePreset This action is a scope for preset generation:UserInputandExecuteactions insidePreparePresetare processed at preset generation time. All other actions are executed as a regular automation. The content ofPreparePresetis ignored at job run time. For example, theUserInputin the following script is processed to generate a preset containing the correspondingSetVar. But at regular job runtime (whether from command line, double click from the backstage or click from the Job Center), it is ignored.
Example Script
XML
<ytriaAutomation Application="sapio365" console="false">
<PreparePreset>
<SetVarListsFromGridColumns target="ShowUsers" cities="city" positions="jobTitle"/><!--make lists of cities and job titles from user module-->
<UserInput Title="Select city and position">
<Variable name="City" Label="Select city" Tooltip="The unique cities from ShowUsers" Type="List">
<ListItem ListName="cities" value="cities"/>
</Variable>
<Variable name="Position" Label="Select position" Tooltip="The unique positions from ShowUsers" Type="List">
<ListItem ListName="positions" value="positions"/>
</Variable>
</UserInput>
<MsgBox Title="Selection made" Message="City is {%City%}" MessageExtended="Position is {%Position%}" Type="eXclamation"/>
</PreparePreset>
<userinput Title="Trace email...">
<Variable name="state1" label="This job searches for messages that meet the following conditions:" Type="label"/>
<Variable name="vsender" value="{%City%}" Label="City:" />
</userinput>
</ytriaAutomation>
JavaScript errors detected
Please note, these errors can depend on your browser setup.
If this problem persists, please contact our support.