Set Values

This command is used to update the values of the specified attributes, for all resources in the specified class, with the specified value. An attribute can be a system attribute (name, description, unit, effective from, effective to, distribution), a user attribute, a property, or a default property.

Note: 
  • If attribute is a property, only the property values within the planning horizon are updated.
  • If the value is not a known attribute or property of class, the value is considered as a constant.

Multiple actions can be performed by specifying multiple sets of attribute and values. An explicit date format can be specified by using the date value with a format specifier as a prefix which indicates the sequence of (d)ay, (m)onth and (y)ear. For example:

  • dmy: 31-12-2019 is ‘31st Dec 2019’
  • ymd: 19-01-02 is ‘2nd Jan 2019’
  • mdy: 3-1-19 is ‘1st Mar 2019’

Syntax

Set Values: <class>.<attribute> = <value>[, <class2>.<Attribute2> = <value2>][... , <classN>.<AttributeN> = <valueN>];
This table lists the arguments that are used in the Set values command:
Argument Description
class The name of class to set values.
attribute The name of the attribute on class to set values. This can be a user attribute, property, default property (*), or a system attribute.
Value The value to set for class.attribute. The value can be an attribute name.
classN The name of class to set values.
attributeN The name of attribute on classN to set values. This can be a user-defined attribute, property, default property (*), or a system class attribute.
valueN The Value to set for classN._attributeN. The value can be an attribute name.

Log message

This table lists the messages logged on successful execution of macro command:
Attribute name Message
Attribute
APACS193=Updated {2} values to {1} for attribute "{0}".

Where,

  • {0} = name of the updated attribute,
  • {1} = the specified value to update the attribute,
  • {2) = number of values updated
Default property
APACS113=Updated {2} values to {1} for default property "{0}".

Where,

  • {0} = name of the updated default property,
  • {1} = the specified value to update the attribute,
  • {2) = number of values updated
Property
APACS111=Updated {2} values to {1} for property "{0}"

Where,

  • {0} = name of the updated property,
  • {1} = the specified value to update the property,
  • {2) = number of values updated
This table lists the exception conditions and the related error message (if applicable) during the execution of the command:
Condition Message
If the class is not a valid class name in the model. This error is reported, and values are not updated:
APACS110=There is no class with name "{0}" defined in the model.

{0} = class name which invalid

If the attribute is not a known attribute or property for the specified class. This error is reported, and values are not updated:
APACS197=Unknown attribute "{0}" for class "{1}".
  • {0} = Attribute name which is unknown
  • {1} = Class name
If the attribute is a property name which is calculated. This error is reported, and values are not updated:
APACS207=Cannot update calculated property "{0}".

{0} = Class.property which cannot be updated.

When updating a numeric attribute (for example, distribution), a default property, or a property, and value is a constant which cannot be converted to a number (for example, ‘12.4.2’). This error is reported, and values are not updated:
APACS118=Invalid number "{0}".

{0} = The value which failed to be converted to a number.

When updating a date attribute (for example, effective from, effective to, effective at), and value is a constant which cannot be converted to a date (for example, “32-24-2011”). This error is reported, and values are not updated:
APACS204=Invalid date "{0}".

{0} = The value which failed to be converted to a date.

When updating a numeric attribute, a default property, or a property where value is another attribute, any values for the value attribute which cannot be converted to a number.
APACS206=Error while updating "{0}" to "{1}" for resource "{2}"
  • {0} = attribute being updated,
  • {1} = Value failed to be converted for use as an updated value
  • {2} = name of resource which failed

This Indicates the faulty resource and value, and those values are set to 0.

Note: 
  • The reason is stated explicitly:
    APACS118=Invalid number "{0}"
    {0} = The value which failed to be converted to a number.
  • Details for the first “10” data conversion errors are logged, after which a warning summary is logged indicating the total number of data conversions failed, and how many has been reported.
    APACS205={0} value conversion errors. Details for the first {1} errors are logged.
    • {0} = total number of data conversion errors
    • {1} = number of errors reported
When updating a date attribute where value is another attribute, any values for the value attribute which cannot be converted to a date.
APACS206=Error while updating "{0}" to "{1}" for resource "{2}".
  • {0} = attribute being updated,
  • {1} = Value which failed to be converted for use as updated value
  • {2} = name of resource which failed

This indicates the faulty resource and value, and those values are updated to an empty date.

Note: 
  • The reason is stated explicitly.
    APACS204=Invalid date "{0}"
    {0) = The value which failed to be converted to a date
  • Details for the first “10” data conversion errors are logged, after which a warning summary is logged indicating the total number of errors occurred, and the number of errors reported.
    APACS205={0} value conversion errors.  Details for the first {1} errors are logged.
    • {0} = total number of data conversion errors
    • {1} = number of errors reported
This table lists the examples of the Set values command:
Requirement Syntax
Set the values of “property” property, for all resources of “Class” class, across the planning horizon.
Set Values: Class.property = 0;
Clear all values of property “property”, for all resources of class “Class”, across the planning horizon.
Set Values: Class.property = nil;
Set the values of “property” property to the value of property “another property”, across the planning horizon.
Set Values: Class.property = another property;
Set the values of default property "property (*)" to the value 100, for all resources of “Class” class.
Set Values: Class.property (*) = 100;
Clear the values of default property "property (*)“, for all resources of”Class" class, effectively resetting the default property values for updated resources to the default value specified in the class definition.
Set Values: Class.property (*) = nil;
Set the values of “unit” attribute to the value “pieces” for all resources of “Class” class.
Set Values: Class.unit = pieces;
Set the values of user attribute “user defined attribute” to the value of attribute “name” for all resources of “Class” class.
Set Values: Class.user defined attribute = name;
Set the values of ‘effective from' date attribute to the 23 of January 2019, for all resources of “Class” class.
Set Values: Class.effective from = 23-01-2019;
Set the values of ‘effective from' date attribute to the 23 of January 2019, for all resources of “Class” class, for a specified date format.
Set Values: Class.effective from = (ymd) 2019-01-23;
Set the values of unit attribute to “pieces”, default property property (*) to 100, and property property to nil, for all resources of “Class” class
Set Values: Class.unit = pieces, Class.property (*) = 100, Class.property = nil;