ArchValueScheduleCollection(coreExpressionViewModel)

new ArchValueScheduleCollection(coreExpressionViewModel)

This class holds a value in Architect Scripting. Data Type: Schedule Collection Note: Do not attempt to create instances of this class directly. They will be created automatically as needed by Architect Scripting.

Parameters:
Name Type Description
coreExpressionViewModel object

( Internal ) an Architect core expression view model.

Extends

Members

static, readonly displayTypeName :string

Implements override support for the display type name string for this Architect Scripting object.

static isArchValueScheduleCollection :boolean

Returns true indicating that this is an ArchValueScheduleCollection instance.

readonly consumesSecureData :boolean

Returns whether or not this value uses secure data. For this to be the case, the value must use a secure variable either in an expression or as the configured variable.

Inherited From:

readonly dataType :ArchDataType

The Architect data type associated with this value.

Inherited From:

readonly flowLevelDefault :ArchBaseValue

If this value has a flow-level default setting value available, this method will return the value for that setting. Otherwise, null will be returned. To see if a value has a flow level default, you can check the ArchValueSettings#hasFlowLevelDefault property.

Inherited From:

readonly hasError :boolean

Returns whether or not this value currently has an error. While this is certainly useful, please note the following:

  • Any asynchronous methods that have been called on this value that are still pending will not update the error state until the asynchronous method completes.
  • This property will reflect the value's view of itself and lots of times you'll want to look at validation results themselves in that the errors or warnings there will have informational strings that specify more information on what's wrong within the context of a containing object. This object can also identify issues between the relationship of multiple values within the object which an individual value cannot. An example of an "object" would be an action within a flow.
Inherited From:

readonly hasErrorOrWarning :boolean

Returns whether or not this value currently has an error or warning. While this is certainly useful, please note the following:

  • Any asynchronous methods that have been called on this value that are still pending will not update the error or warning state until the asynchronous method completes.
  • This property will reflect the value's view of itself and lots of times you'll want to look at validation results themselves in that the errors or warnings there will have informational strings that specify more information on what's wrong within the context of a containing object. This object can also identify issues between the relationship of multiple values within the object which an individual value cannot. An example of an "object" would be an action within a flow.
Inherited From:

readonly hasWarning :boolean

Returns whether or not this value currently has a warning. While this is certainly useful, please note the following:

  • Any asynchronous methods that have been called on this value that are still pending will not update the warning state until the asynchronous method completes.
  • This property will reflect the value's view of itself and lots of times you'll want to look at validation results themselves in that the warnings there will have informational strings that specify more information on what's wrong within the context of a containing object. This object can also identify issues between the relationship of multiple values within the object which an individual value cannot. An example of an "object" would be an action within a flow.
Inherited From:

readonly isArchBaseCoreObject :boolean

Returns true indicating that this is an ArchBaseCoreObject instance.

Inherited From:

readonly isBuilder :boolean

Returns whether or not this value is set to a builder value. While builders end up generating expression text that specifies how the value should be calculated, they cannot be changed in Architect Scripting. You can call different methods on an ArchBaseValue instance such as ArchBaseValue#setExpression to set this to an expression or value type specific literal setter such as ArchValueString#setLiteralString on a ArchValueString instance to set this to a literal.

Inherited From:

readonly isCollection :boolean

Returns true indicating that this is a collection.

Inherited From:

readonly isExpression :boolean

Returns whether or not this value is set to a expression value.

Inherited From:

readonly isLiteral :boolean

Returns whether or not this value is set to a literal value.

Inherited From:

readonly isNoValue :boolean

Returns whether or not this value is set to no value. Note that this does not mean the value is NOT_SET. It means there is no value specified for this value.

Inherited From:

readonly isNoValueNoFallback :boolean

Returns whether or not this value is set to no value with no fallback. Note that this does not mean the value is NOT_SET. It means that there is no value specified for this value and the flow's runtime handling, such as picking up a default value for a setting somewhere else, should not be used.

Inherited From:

readonly isVariable :boolean

Returns whether or not this value is set to a variable value. Note that this is true when the value is set by calling ArchBaseValue#setVariable. If you set the value with an expression, the return value will be false even if the expression is only a variable reference.

Inherited From:

readonly isVariableInitialValue :boolean

Returns whether or not this value is the initial value for a variable.

Inherited From:

readonly length :number

Returns the number of Architect value items in this collection if this value is a literal. Remember that asynchronous calls to add items to literal collection values will not add the item to the collection until the asynchronous processing successfully completes.

Inherited From:

readonly logStr :string

Returns a logging string that describes this Architect value.

Inherited From:

readonly logStrTypeOnly :string

This is a string suitable for logging information about this object where it's just the object's type. This is normally used when logging errors that occur in constructor parameter checking because the scripting object isn't set up and the normal logging str contents wouldn't be set up.

Inherited From:

readonly overridesDefaultValue :boolean

Returns whether or not this value is overriding another default value. For example, this is true when this a value overrides a flow level setting value.

Inherited From:

readonly parent :ArchBaseObject

The parent Architect Scripting object associated with this value.

Inherited From:

readonly parentFlow :ArchBaseFlow

Returns the parent flow for this value.

Inherited From:

readonly settings :ArchValueSettings

Returns the settings associated with this value which provides meta data about this value like whether it is an output, can be set to a literal, can be set to an expression, etc. etc.

Inherited From:

readonly valueText :string|Array.<string>

Returns a JavaScript string or string array for this collection value. If this value is an expression, it returns the expression text. If this value is a variable, it returns the variable text. If this value is a literal, the return value will be a JavaScript string array where each item's value in the array will be generated by accessing the valueText property for it. Please be sure to see ArchBaseNetworkValue#valueText for more information on the string formatting. Overall this property is meant to be a quick and easy way to look at a "value" string for a collection value but it is not meant to be some kind of fully inclusive description of this ArchBaseValueBasicCollection instance overall.

Inherited From:

Methods

addItemToCollection() → {ArchBaseValue}

This changes the value to a literal, creates a new ArchBaseValue instance, adds it to the end of the collection and returns it. The returned value will be the appropriate type for items contained in the collection. As such, if you added an item to an ArchValueQueueCollection, the returned item would be an ArchValueQueue value.

Returns:
ArchBaseValue -
  • the newly created ArchBaseValue that was added.
Inherited From:

addLiteralByScheduleIdAsync(scheduleId, callbackFunctionopt) → {Promise.<ArchValueScheduleCollection>}

Adds a schedule to this collection looking up the schedule to add by the schedule by id

Parameters:
Name Type Attributes Description
scheduleId string

the identifier of the schedule.

callbackFunction callbackArchValueScheduleCollection <optional>

a callback function to call if the schedule is successfully looked up and added to this schedule collection value. The first parameter passed to the callback function will be this schedule collection value instance.

Returns:
Promise.<ArchValueScheduleCollection>

addLiteralByScheduleNameAsync(scheduleName, callbackFunctionopt) → {Promise.<ArchValueScheduleCollection>}

Adds a schedule to this collection looking up the schedule to add by the schedule name

Parameters:
Name Type Attributes Description
scheduleName string

the name of the schedule.

callbackFunction callbackArchValueScheduleCollection <optional>

a callback function to call if the schedule is successfully looked up and added to this schedule collection value. The first parameter passed to the callback function will be this schedule collection value instance.

Returns:
Promise.<ArchValueScheduleCollection>

clearCollection()

Clears all values from this collection.

Inherited From:

getExpressionText() → {string}

If this value is an expression, this method will return the expression text.

Returns:
string
Inherited From:

getItemByIndex(index) → {ArchBaseValue}

Returns the Architect value associated with the collection at the specified index if this value is a literal.

Parameters:
Name Type Description
index number

the index of the collection item to retrieve. This value should be a non-negative integer.

Returns:
ArchBaseValue
Inherited From:

getVariable() → {ArchBaseVariable}

If this value is a variable reference, this method will return the variable that is being referenced.

Returns:
ArchBaseVariable
Inherited From:

isFilterMatch(archFilterObject) → {boolean}

Returns whether or not this Architect Scripting object is a match for the supplied ArchFilterObject instance.

Parameters:
Name Type Description
archFilterObject ArchFilterObject

the object filter to use to determine if it's a match.

Returns:
boolean
Inherited From:

logError(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true.

Parameters:
Name Type Description
errorStr string

the error string to log.

Inherited From:

logErrorAndThrow(errorStr)

Logs an error to the logging service with a log header from this object's logStr property value when ArchLogging#logErrors is true and then throws the string in the errorStr parameter.

Parameters:
Name Type Description
errorStr string

the error string to log. This should be a non-blank string.

Throws:
  • Throws the submitted error string.
Inherited From:

logNote(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotes is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Inherited From:

logNoteVerbose(noteStr)

Logs a note to the logging service with a log header from this object's logStr property value when ArchLogging#logNotesVerbose is true.

Parameters:
Name Type Description
noteStr string

the note string to log. This should be a non-blank string.

Inherited From:

logWarning(warningStr)

Logs a warning to the logging service with a log header from this object's logStr property value when ArchLogging#logWarnings is true.

Parameters:
Name Type Description
warningStr string

the warning string to log. This should be a non-blank string.

Inherited From:

setExpression(expressionText)

This sets the expression text on this value. If the expression cannot be set because the expression text is invalid, you're trying to set an expression on an output, etc. etc. the call will fail. If you wish to have the ability to set syntactically invalid expression text on an ArchBaseValue object and not have this method throw, you can set the ArchValueSettings.allowInvalidExpressionText property to true prior to calling the setExpression function and Scripting will not throw an error if the expression text is invalid. Remember, output values are required to be variables so you should use setVariable on those calls instead of passing in expression text that references a variable.

Parameters:
Name Type Description
expressionText string

the expression to set on this value.

Throws:
  • This method will throw if it is unable to set the supplied expression text with an error describing why.
Inherited From:

setExpressionFromVariable(variableToAssign)

This method sets the value to an expression and assigns the variable's name as the expression text.

Parameters:
Name Type Description
variableToAssign string | ArchBaseVariable

the variable to assign passed in either by a string like 'Flow.myInteger' or an Architect variable. If the value is a string, this function will attempt to look up the variable and if it doesn't exist then create it. Next it will assign the variable name as the expression text. If you pass in an ArchBaseVariable reference, it needs to be in scope for this value.

Inherited From:

setNoValue()

This method sets the value to no value. Note that this is different from setting NOT_SET or something like a blank string. Setting a value to contain no value is something which is rather internal to Architect but we're exposing it in scripting. In a nutshell, setting no value means to take advantage of default runtime handling. The default runtime handling can change based on where this is used. For example, setting no value for a variable initial value means that the runtime will set a non-collection variable to NOT_SET or a collection variable to an empty collection. On a value that has a flow level default, setting it to no value means that the runtime should pick up the value to use from the flow level default. And if a flow level default allows no value, that means that the runtime will pick up the value from somewhere else normally defined in Admin. An example of this is that the connect timeout specified for a Transfer to Number action that it would use the Edge trunk connect timeout.

Inherited From:

setNoValueNoFallback()

This method sets the value to no value but with no fallback. This is different that setNoValue in that you are explicitly setting the expression to no value and you do not want to use the flows default value for this setting.

Inherited From:

setVariable(variableToAssign)

This method sets the value to a variable and assigns the supplied variable to it. One thing to be aware of is when a value reports that it is an input, the value may not allow you to call this method to configure a variable if the value's can be variable setting reports false. Assuming that the value reports it can be an expression, please look at using the ArchBaseValue#setExpressionFromVariable method instead.

Parameters:
Name Type Description
variableToAssign string | ArchBaseVariable

the variable to assign passed in either by a string like 'Flow.myInteger' or an Architect variable. If the value is a string, this function will attempt to look up the variable and if it doesn't exist then create it. Next it will assign the variable name as the expression text. If you pass in an ArchBaseVariable reference, it needs to be in scope for this value.

Inherited From:

traverse(callbackFunction, traverseFilteropt) → {number}

This method iterates over this object and ArchBaseCoreObject instances within it. For each object it will call the ArchBaseObject#isFilterMatch method with a filter and call the supplied callback function if isMatch returns true. The callback will be passed an ArchTraverseInfo with details about the match such as the match object itself along with current contextual information such as the object hierarchy for the match object relative to the object on which this traverse call is being made.

The traverse filter is one which you can create by calling ArchFactoryFilters#createFilterObject and then add desired clauses or clause containers to it. If not specified, this function will use a default filter.

Here is an example that does a simple flow traversal using the default filter and logs information about objects in the callback from the traverse object that's passed back:

archInboundCallFlow.traverse(function(traverseInfo) {
   archLogging.logNote('  Object     : ' + traverseInfo.matchObject.logStr);
   archLogging.logNote('    Hierarchy: ' + traverseInfo.context.hierarchyStr);
});

This might be enough for most uses and you can check various aspects about the object in the callback such as "is this an Architect action?" by seeing if traverseInfo.matchObject.isArchBaseAction is true. You can specify a filter for the traversal code to use as well and only have it call your callback when the object's ArchBaseCoreObject#isFilterMatch method returns true for the filter. Here's an example that creates a filter for callbacks on any type of transfer action, any decision action or objects whose name property case insensitively matches the word 'foo'. While this could all be done with one property callback clause the example will use multiple clauses for the sake of simplicity:

const myTraverseFilter = filterFactory.createFilterObject(archEnums.FILTER_CONTAINER_OPERATORS.or);
myTraverseFilter.addClausePropertyValueEquals('isArchBaseActionTransfer', true);
myTraverseFilter.addClausePropertyValueEquals('isArchActionDecision',     true);
myTraverseFilter.addClausePropertyCallback('name', function(propValue, archContainingObject, propName) {
      // We fully spelled out the function signature above but archContainingObject and propName are
      // not needed in this case.  The archContainingObject is the object that contains the
      // property and propName is the property name itself.  We pass in propName because the same
      // function could be used for multiple property callback clauses.
      // Remember to return a boolean true, false or undefined from ths callback.  :)
      return propValue && propValue.toLowerCase() === 'foo';
});
archTask.traverse(function(traverseContext) {
   // You will only be called back here for ArchBaseCoreObject instances that
   // have the isArchBaseActionTransfer or isArchActionDecision property values equal to true.
}, myTraverseFilter);

If you supply a filter with no clauses, this tells the traverse method to call the supplied callback function for every ArchBaseCoreObject it traverses.

If you want traversal itself to stop after a callback, simply return boolean false from the callback function you supply to the traverse call.

The traverse method does not process deprecated property names such as orgId, orgName or languageSettings. Additionally it does not traverse in to properties that would "jump out" of the current traversal. An example of this would be if the code was traversing an ArchActionJumpToMenu action that it would not start traversing in to the menu that it jumps to. Another example would be a ArchActionChangeState action where it would not traverse in to the target state of the action. This also means traversal does not traverse in to the ArchBaseValue#flowLevelDefault property.

And lastly, as Scripting evolves over time with new versions, you can expect to get callbacks for new object types such as new actions or new properties on objects. As such, it's important not to assume any particular order in callbacks to keep code most compatible with traversal callbacks. Or if you use inequality checks in filter clauses remember that new "stuff" may satisfy an inequality check which may or may not be anticipated in your logic.

Note: This traverse method is a helper method and is very handy for iterating over Architect Scripting objects and their properties in a generic fashion with filtering capabilities. Obviously you can write your own custom traversal code if this implementation doesn't cut it for some reason. :)

This function returns the number of times it called the callback function.

Parameters:
Name Type Attributes Default Description
callbackFunction callbackTraverseInfo

the callback function to call for objects that match the traverse filter.

traverseFilter ArchFilterObject <optional>
ArchFactoryFilters#createFilterTraverseDefault

the filter to use when performing the traversal to determine which ArchBaseCoreObject instances you wish to be called back for. If no filter is specified, this function will call ArchFactoryFilters#createFilterTraverseDefault and use that traversal default filter. The wantArchBaseValues parameter on that call is set to true.

Returns:
number
Inherited From: