Resource Object

This section describes the purpose of the Resource object and its properties. Below you will find a general overview, followed by a detailed description of Resource Properties, as they appear in the various Resource categories (tabs).

 

A Resource is a shared object that can be used (associated with) multiple Jobs and Plans. The object is used when creating a Resource Constraint. A constraint is a condition that must be met before a triggerable object (Job or Plan) can be dispatched to run. A Resource is either a static numeric value that you assign to the Resource object, which ActiveBatch then controls, or it is a dynamic numeric value that may, or may not, be under ActiveBatch's sole control.

 

Using examples is the best way to describe Resource object usage. Let's look at the two types below, starting with the static (constant) Resource.

 

  • A constant Resource is a constant numeric value that you specify, and it remains the same unless you change it on the object definition.  However, its usage as tracked, as described in the example below.

    • Example:

      • You have 10 Jobs that access a specific software product for which you have licensed. The terms of the license specify that only 5 Jobs can run at the same time, to remain in license compliance.

      • To make sure you never exceed the running Job limit of 5, you can create a Resource object named "Licensed Apps” and assign it a constant value of 5.

      • Next, you would add a Resource Constraint to the 10 Jobs that use the licensed software, and configure it such that it uses the Resource Object, where each Job needs 1 unit to run.

      • When a Job configured with this Resource Constraint triggers, the Scheduler will see if any of the 5 units are available. If a unit is available, the Job is allocated 1 unit (satisfying the constraint), and the Resource object's available count is reduced by 1. The Job "keeps" the unit until it completes (success, failure or aborted). After Job completion, the unit is returned to the Resource Object, increasing the count by 1. In summary, a Resource Object's units are reduced by 1 while a Job is active , and then increased by 1 when the Job completes.

      • If all 5 units are allocated to 5 running instances when another Job triggers that is configured with this constraint, the Job will wait for a unit to become available - or the Job will fail, depending on properties set on the constraint.

  • An active variable (dynamic) Resource is initialized from a built-in data source, and while its usage is tracked, the Resource may (optionally) be re-populated over a time period. The data sources you will see when configuring an active Resource are the same data sources supported by active variablesClosed An active variable's value is obtained from one of many data sources that are built-in to the ActiveBatch product. Example data sources include: A Windows Registry key, a SQL Server database table used in a SQL Query, a text file, an XML file, etc. Active Variables are resolved by the Job Scheduler, before the Job is sent to the Execution Agent to run. .

    • Example:

      • You have a Job that needs a certain amount of disk space on the Execution AgentClosed The Execution Agent ("Agent") is the component that runs ActiveBatch jobs. It must be installed and configured on a system that is specified in the Machine property of an Execution Queue object. The Job Scheduler uses the Queue's Machine property to determine what system to connect to in order to dispatch jobs. Most ActiveBatch environments have more than one system with an Agent installation. Which Agent to send the Job to is based on the Submission Queue that is assigned (associated) to each Job, a required Job property. system in order to run properly. Since programs other than those launched by ActiveBatch allocate space on the drive - a constant Resource won’t work.

      • To make sure there is enough disk space, you can create a Resource object named C_FreeSpace that uses an active variable WQL SELECT statement to obtain the current amount of free space on drive C.

      • Next, you would add a Resource Constraint to the Job that needs the disk space checked, and configure it such that it uses the Resource object, and specify how many units it needs.

      • When the Resource Constraint Job triggers, the system will check if there are enough units to allocate to the Job.  If there is, the Job's constraint will be met, and the amount of units needed by the Job will be reduced (subtracted) from the Resource object. It is reduced to ensure, at that moment, that the Resource amount is still accurate.

      • The return of units to the Resource object, (after the Job completes) depends on whether you have enabled the re-evaluation property of the Resource object.

        • When re-evaluation is enabled, the Scheduler will re-evalaute the Resource object (in this case, the amount of free disk space), every "x" seconds, where seconds is defined using the "Expires in" property. The intent is to ensure the most accurate number for the Resource object being used. When a Resource has this property set, the units are not returned to the Resource object after the Job completes, because the Resource object's value will be updated after the re-evaluation takes place.

          • For example, assume you choose to re-evaluate the amount of free disk space. If the Resource object had an initial value of 100,000,000 and JobA needed 5,000,000, the resulting Resource object would be reduced to 95,000,000. When the Job completes, the 5,000,000 resource units are not returned to the Resource object, because the re-evaluation option is enabled and will likely yield a more accurate value.

        • When re-evaluation is not enabled the Resource is set one time. The Resource object is subject to subtracting the value when the units are allocated for the Job, then returning the units back to the Resource object when the Job is complete. This is the same behavior when using a constant Resource object value. The only difference is the initial value for the active Resource came from an active variable, not a constant value entered by the user.

      Note: An active variable Resource object soley under ActiveBatch's control should not be set for a timed re-evaluation (Never should be selected). An active variable Resource object not under ActiveBatch's sole control (like the above example - where the value can change due to influences outside of ActiveBatch) should be set for a timed re-evaluation - (Expires in should be selected/configured).

To create a Resource object, right-click on the desired container (Scheduler root, existing Folder or Plan) in the Object Navigation Pane, select New, then select Resource. When you’ve completed the Resource property settings, you must click the Save or the Save and Close button to save the Resource. Click the X on the tab of the New Resource if you wish to cancel the creation of the Resource. When you save the Resource, it will instantly appear in the Object Navigation pane (if auto refresh is enabled). To modify an existing Resource, right-click on the Resource in the Object Navigation pane, then select Properties.

 

Resource Properties

 

Status of the Resource object (Total Units / Available Units)

 

To see the current status of a Resource, click on the Resource object and examine the current state of the Resource object via the Properties pane. See the image below. Observe that 13 units are available out of a total of 15.

 

 

Alternatively you can right-click on a container where Resource object(s) have been placed.  Then select View>Browse>Resource Objects. The results will be tabbed in the Main view, as depicted in the image below.

 

 

Evaluate Now

 

Selecting the “Evaluate Now” operation causes the Resource’s active variable data source to be immediately re-evaluated, regardless of any timed or lack of timed-base settings.

 

To access this feature, navigate to the desired Resource object in the Object Navigation pane.  Right click on it, then select Evaluate Now.  This will force the reevaluation of the Resource, in between intervals.

 

See the image below that depicts this.