Lock Up To

This command is used to lock all Class properties with name property name for the specified number of buckets. These are the possible optimizations:
  • Parameter class name is optional.
    • If the class name parameter is not specified, the command locks all class properties with name property name in the specified buckets.
    • If the class name parameter is specified, the command locks the specific class property with name property name in the specified buckets.
  • If the parameter number of buckets < 0, the indicated property gets unlocked for all buckets.
  • If the parameter number of buckets = 0, the indicated property gets unlocked for all buckets.
  • If the parameter number of buckets > 999, the indicated property gets locked for all buckets. This includes the case when the calendar holds more than 999 buckets.
  • If the parameter number of buckets is greater than the number of buckets in the calendar, the indicated property is locked for all buckets in the calendar. This includes the case when the calendar is empty; any bucket created after is considered locked for the indicated property.

Lock Up To command sets a condition to lock the specified property and buckets, which are applicable to optimizations as follows:

  • The command is executed several times to include multiple property and bucket combinations to the lock conditions.
  • Execution of the command from nested workflows can modify the lock conditions.
  • The lock conditions are retained for the entire life span of the outermost workflow execution.
    Note: The lock condition stops when the outermost workflow execution is completed.
  • The lock conditions are applicable within the outermost workflow or a nested workflow.
Note: Subsequent executions of Lock Up To command can overwrite locks set by a previous execution of this command for the same property.
Syntax
Lock Up To: <number of buckets>, [class name.]<property name>;
Log message
This table lists the messages logged on successful completion of macro execution:
Condition Message
When parameter number of buckets > 0, for each Class.property locked.
APACS289=Locked property "{0}" for the first {1} buckets.

{0} = Class.property name identified for the property name and/or class name parameters.

{1} = number of buckets locked.

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

When parameter number of buckets <= 0, for each Class.property locked. APACS290=Cleared locks for property "{0}" for all buckets

{0} = Class.property name.

When parameter number of buckets is > 999, or number of buckets is greater than the number of buckets in the calendar.
 APACS301=Locked property "{0}" for all buckets.

{0} = Class.property name.

This table lists the exception conditions and the related error message (if applicable) during the execution of the command:
Exception condition Error message
class name is not specified, and there are no classes which have a property of name property name.
APACS288=There are no classes containing a property with name "{0}".

{0} = property name parameter value.

class name is specified; however, the class is not known within the model.
APACS110=There is no class with name "{0}" defined in the model.

{0} = class name parameter value.

class name is specified and valid; however, property name is not defined for that class.
APACS109=There is no property with name "{0}" defined for class "{1}".

{0} = property name parameter value.

{1} = class name parameter value.

This table lists the examples of the Lock Up To command:
Requirement Syntax
Lock property planned production of class Resources, for the first 2 buckets in the calendar.
Lock Up To: 2, Resources.planned production;
Lock property planned production of all classes, for all buckets in the calendar.
Lock Up To: 1000, planned production
Clear locks for property planned production of class Resources, for all buckets in the calendar.
Lock Up To: -1, Resources.planned production;
Lock property planned production of class Resources, for the first 2 buckets in the calendar.
Lock Up To: 10, Resources.planned production;
Lock Up To: 2, Resources.planned production;
Note: The second command overwrites the locks set by the first command.
Set locks by a nested workflow.

Execution of workflow Do Solve With Locks, calls workflow Set Lock Criteria to lock the property planned production for the first 2 buckets, before performing a solve of optimization name Optimize Production.

The solve of optimization Optimize Production consider property planned production as locked for the first 2 buckets.

Execution of workflow Do Solve, performs a solve of optimization name Optimize Production. In this case, the solve of optimization Optimize Production does not consider any locks that are set from the previous execution of Do Solve With Locks.

  • Do Solve:
    Solve: Optimize Production;
    
  • Do Solve With Locks:
    Workflow: Set Lock Criteria;
    Solve: Optimize Production;
    
  • Set Lock Criteria:
    Lock Up To: 2, planned production;