new ArchActionOutput(coreActionPathViewModel)
Parameters:
| Name | Type | Description |
|---|---|---|
coreActionPathViewModel |
object | ( Internal ) an Architect core action path view model. |
Extends
Members
-
static, readonly displayTypeName :string
-
Returns the display type name string 'ArchActionOutput'.
-
readonly actionCount :number
-
Returns the number of actions in this multi action container.
- Overrides:
-
readonly actionFirst :ArchBaseAction
-
Returns the first / starting action in this container's action list. For a task or state, this would be the starting action. If there is no first action, nothing is returned.
- Overrides:
-
readonly actionLast :ArchBaseAction
-
Returns the last action in this container's action list. If there is no last action, nothing is returned. Remember, this does not mean this would be the last action to execute at runtime because the last action may have outputs with actions contained underneath them.
- Overrides:
-
readonly actions :Array.<ArchBaseAction>
-
Returns an ordered array that contains the top level actions contained in this container. By top level this means that actions which are contained in outputs of actions will not be included in this array. If there are no actions, an empty array is returned. The action at index 0 will be the first action in this container. For example, if this were actions contained in a task or state, the action at index 0 is the starting / first action.
- Overrides:
-
readonly canEnableDisable :boolean
-
Returns whether this action output can be enabled or disabled. A disabled action output does not show in the Architect UI unless there are actions in it. The output path will be displayed as unreachable and once all actions are removed from underneath it, it will no longer be shown in the UI. Execution will not take a disabled output at runtime. Remember that whether an action output can be disabled is also dependent on the parent flow such as whether it is
read onlyor not. -
enabled :boolean
-
Whether the output is enabled for runtime execution. An enabled action output will be displayed in the UI. If it's disabled and there are no actions in the output path, it will be hidden from the flow author. Remember that you can access the
ArchActionOutput#canEnableDisableproperty to see whether it is ok to set a value on the enabled property. IfArchActionOutput#canEnableDisablereturns false for this output and code attempts to set an enabled value, the property setter will throw. -
readonly id :string
-
The identifier for this action output. For known outputs such as the Yes output on a decision action, this string will be a string value from the
ArchEnums#OUTPUT_IDS_ALLarray. For dynamically created outputs such as outputs on anArchActionSwitchorArchActionCallLexBot, the identifier will be a guid.- Overrides:
-
readonly idMayBeBlank :string
-
Returns whether or not the id property may be blank or undefined for this object. For example, the returned settings from
ArchMenu#settingsMenuwill have a blank identifier along with the settings returned fromArchMenu#settingsSpeechRec. Note that this is an extremely rare case.- Overrides:
- See:
-
readonly isArchActionOutput :boolean
-
Returns true indicating that this is an ArchActionOutput instance which means it's an output on an Architect action.
-
readonly isArchBaseCoreObject :boolean
-
Returns true indicating that this is an ArchBaseCoreObject instance.
-
readonly isDynamic :boolean
-
Whether the output is dynamic. A dynamic action output is an output that is not built in to the action. The Yes or No outputs on a
ArchActionDecisionaction are not dynamic. Dynamically created cases on a switch action, intent outputs on various bot actions such as theArchActionCallLexBotor intent outputs on theArchActionAskForIntentaction are dynamic because they are created dynamically rather than being hard coded on an action. -
readonly isMenuChoiceContainer :boolean
-
Returns whether or not this action container is in a menu choice. If so, you cannot add actions to it. Actions are added to menu choices when menu choices are created by different methods on the ArchFactoryMenus.
- Overrides:
- See:
-
readonly isTerminated :boolean
-
Returns whether or not all paths of execution are terminated ( i.e. have terminating actions ).
- Overrides:
-
readonly isVariableContainer :boolean
-
Returns whether or not this object acts as a variable container which means you can add variables to it.
-
readonly label :string
-
The label of this output ( i.e. Success, Failure, Timeout, etc. etc. ) Note: The name and label properties on this class return the same string value. This is by design.
-
readonly logStr :string
-
A string suitable for logging
- Overrides:
-
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.
- Overrides:
-
readonly name :string
-
The name of this output ( i.e. Success, Failure, Timeout, etc. etc. ) Note: The name and label properties on this class return the same string value. This is by design.
-
readonly parentAction :ArchBaseAction
-
Returns the Architect action that contains this output.
-
readonly parentFlow :ArchBaseFlow
-
Returns the parent flow for the action that contains this action output. This is a helper method that internally calls
ArchActionOutput#parentActionand on the returnedactionit then callsArchBaseAction#parentFlow.
Methods
-
canAddAction(archDefinitionAction) → {boolean}
-
Returns whether or not the specified action can be added to this container.
Parameters:
Name Type Description archDefinitionActionArchDefinitionAction the action definition to check.
Returns:
boolean- Overrides:
-
deleteAction(archActionToDelete)
-
Deletes the specified action from this container.
Parameters:
Name Type Description archActionToDeleteArchBaseAction the action to delete.
- Overrides:
-
isFilterMatch(archFilterObject) → {boolean}
-
Returns whether or not this Architect Scripting object is a match for the supplied ArchFilterObject instance.
Parameters:
Name Type Description archFilterObjectArchFilterObject the object filter to use to determine if it's a match.
Returns:
boolean- Overrides:
-
logError(errorStr)
-
Logs an error to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logErrorsis true.Parameters:
Name Type Description errorStrstring the error string to log.
- Overrides:
-
logErrorAndThrow(errorStr)
-
Logs an error to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logErrorsis true and then throws the string in the errorStr parameter.Parameters:
Name Type Description errorStrstring the error string to log. This should be a non-blank string.
Throws:
- Throws the submitted error string.
-
logNote(noteStr)
-
Logs a note to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logNotesis true.Parameters:
Name Type Description noteStrstring the note string to log. This should be a non-blank string.
- Overrides:
-
logNoteVerbose(noteStr)
-
Logs a note to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logNotesVerboseis true.Parameters:
Name Type Description noteStrstring the note string to log. This should be a non-blank string.
- Overrides:
-
logWarning(warningStr)
-
Logs a warning to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logWarningsis true.Parameters:
Name Type Description warningStrstring the warning string to log. This should be a non-blank string.
- Overrides:
-
moveAction(archActionToMove, archActionNewPreviousActionopt)
-
Moves an action in the action container to a different position.
Parameters:
Name Type Attributes Default Description archActionToMoveArchBaseAction the action to move in this container.
archActionNewPreviousActionArchBaseAction <optional>
If not specified, moves the action to the top of this action container. the destination action in this container above which the action specified in the archActionToMove parameter should be moved.
- Overrides:
-
traverse(callbackFunction, traverseFilteropt) → {number}
-
This method iterates over this object and ArchBaseCoreObject instances within it. For each object it will call the
ArchBaseObject#isFilterMatchmethod with a filter and call the supplied callback function if isMatch returns true. The callback will be passed anArchTraverseInfowith 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
filteris one which you can create by callingArchFactoryFilters#createFilterObjectand then add desired clauses or clause containers to it. If not specified, this function will use adefault 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#isFilterMatchmethod returns true for the filter. Here's an example that creates a filter for callbacks onany type of transfer action, anydecision actionor 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
ArchBaseCoreObjectit 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,orgNameorlanguageSettings. 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 anArchActionJumpToMenuaction that it would not start traversing in to the menu that it jumps to. Another example would be aArchActionChangeStateaction where it would not traverse in to the target state of the action. This also means traversal does not traverse in to theArchBaseValue#flowLevelDefaultproperty.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 callbackFunctioncallbackTraverseInfo the callback function to call for objects that match the traverse filter.
traverseFilterArchFilterObject <optional>
ArchFactoryFilters#createFilterTraverseDefaultthe filter to use when performing the traversal to determine which
ArchBaseCoreObjectinstances you wish to be called back for. If no filter is specified, this function will callArchFactoryFilters#createFilterTraverseDefaultand use that traversal default filter. The wantArchBaseValues parameter on that call is set to true.Returns:
number- Overrides: