Contact us to schedule a demo or ask a question to learn how AdvantageCS can help you.

Advantage Blog

The Molly Minute >>

Scripted Request System

ACS has developed a Scripted Request System to aid clients in requesting processes and/or jobstreams from scripts which run outside of Advantage.  Capsules have been created to allow users to communicate with the Advantage Monitor from the command line, wait until a process finishes and then return a success or failure code. This is not intended to replace the request screens but rather to give clients a way to interface with an enterprise scheduling system for selected processes or jobstreams. The processes still run under the control of the Advantage Monitor and the monitor notifies the scheduling system when the process or jobstream is complet

The interface to the scripted request system is a powershell named advantage_submit.ps1 that is distributed with Advantage Revisions starting at 2011r1.

This script file has a –help parameter which allows you to list the parameters that are needed for a given process or jobstream. For instance, when requesting the CIR410 process with the –help parameter, you would receive the following message:

Sequence Option Name   Reqd  Prompt                      Default

0140     ERR-OPT       No    Continue on Error?          N

0500     PUB-CDE       Yes   Publication Code

0520     CE-MODE       No    Processing Mode             M

0540     CE-VALD       No    Validate Database?          N

0560     CE-SL         No    Sub Liability Rpt?          Y

0580     CE-LBL        No    Produce Labels?             N

This shows the user that the CIR410 process must be requested with a PUB-CDE parameter and what the defaults are for the other parameters. Those defaults can be overridden when requested at the command line. Providing invalid or misspelled parameters results in the process or jobstream not running. Error/Success codes returned:

 0 Success  1 Only help was displayed -1 No Jobstreams with the name supplied -2 Bad Name or setting in the parameter string -3 Blank name or setting in the parameter string -4 Missing Parameter -5 Invalid or Closed Parameter (possibly misspelled) -6 Invalid Process Name -7 Problem Launching Process -8 Invalid pub directory on command line

The results of the request are displayed on the screen as the process runs. The Scripted Request System uses the Process_Notification capsule to notify the waiting script that the process has finished. A new environment variable, SCRIPTLOC, has been added to control where the scripted request temporary files are created. SCRIPTLOC defaults to pub\scripts and the directory that SCRIPTLOC points to must be created before using the Scripted Request System.

Usage of these capsules could allow system administrators to use scheduling systems to schedule backups and then run processes as soon as the backup finishes.

Filed under: The Molly Minute