Lock Selection Up To

This command is used to lock the selected resources for the specified number of buckets number of buckets and the optimizations as follows:

  • When the parameter number of buckets < 0, the selected resources are unlocked for all buckets.
  • When the parameter number of buckets = 0, the selected resources are unlocked for all buckets.
  • When the parameter number of buckets > 999, all buckets are locked for the selected resources.
    Note: If number of buckets is more than 999 buckets in the calendar, all buckets are locked. This includes the case when the calendar holds more than 999 buckets.
  • When the parameter number of buckets is greater than the number of buckets in the calendar, the selected resources are locked for all buckets in the calendar.
    Note: If the calendar is empty; any buckets created after must be considered as locked for the selected resources.

The Lock Selection Up To command can set a condition to lock for the selected resources, which are applicable to these optimizations:

  • The resources in the lock criteria are considered locked for all properties of those resources and indicated buckets.
  • The command can be executed several times to include multiple resource selections and bucket combinations to the lock criteria.
  • Execution of the command from nested workflows modifies the lock conditions.
  • This lock conditions are retained for the entire life span of the outermost workflow execution.
    • The lock criteria ceases when the outermost workflow execution is completed.
  • The lock criteria are applied to in the outermost workflow or to a nested workflow optimizations.
Note: Subsequent executions of this command can overwrite locks set by a previous execution of this command for the same resource.

Syntax:

Lock Selection Up To: <number of buckets>;

Log message:

This table lists the messages logged on successful completion of macro execution:
Condition Message
When the parameter number of buckets > 0
APACS304=Locked {0} resources for the first {1} buckets.
  • {0} = number of selected resources which are being locked
  • {1} = number of buckets locked

    If parameter number of buckets is > 999, log the total number of buckets in the calendar

When the parameter number of buckets is <=.
APACS305=Cleared locks for {0} resources for all buckets.

{0} = number of selected resources which are being locked.

When parameter number of buckets is > 999, or number of buckets is greater than the number of buckets in the calendar.
APACS305=Cleared locks for {0} resources for all buckets.

{0} = number of selected resources which are being locked.

This table lists the examples of the Lock Selection Up To command:
Requirement Syntax
Lock all resources of class Products that have value ‘X’ for attribute Type, for the first bucket in the calendar.
Select: Products.Type = X;
Lock Selection Up To: 1;      
Lock selected resource ‘Product1’ for all buckets in the calendar.
Select: Products.name = Product1;
Lock Selection Up To: 1000;     
Clear locks for selected resources, for all buckets in the calendar
Lock SelectionUp To: -1;
Lock resource ‘Product1’ for the first 10 buckets, and lock resource ‘Product2’ for the first 2 buckets in the calendar.
Select: Products.name = Product1;
Lock Selection Up To: 10;
Select: Products.name = Product2;
Lock Selection Up To: 2;       
Lock resource ‘Product1’ for the first 2 buckets in the calendar.
Select: Products.name = Product1;        
Lock Selection Up To: 10;
Lock Selection Up To: 2;
Note: The second command can overwrite the locks set by the first command against the same selection.