Get Number Of Sub Contexts
  • 19 Jan 2023
  • 1 Minute to read
  • Dark
    Light

Get Number Of Sub Contexts

  • Dark
    Light

Article Summary

Step Details

Introduced in Version4.0.0
Last Modified in Version5.12.0
LocationSystem > Advanced > Debugger

The Get Number Of Sub Contexts step will return the number of the specified sub context type.


Properties

Inputs

PropertyDescriptionData Type
Debug IdThe Id of the debugged FlowString
Only ChildrenDetermines whether only child elements are returnedBoolean
Sub Context TypeAllows the user to specify the sub context type to be returned (All, Flows, Rules, Forms)---

Outputs

PropertyDescriptionData Type
OutputThe number of sub contexts within the debugged FlowString

Example Inputs and Outputs

Debug IdOnly ChildrenSub Context TypeOutput
6892a6da85c343148757ba98156a6e34_debug.5a2b35e7-afc3-45df-9b65-211a435d2e8d
FalseFlows0
1160d151c0854eadb54ca79a76eab017_debug.ff4150cf-63c8-4e12-b3ff-cd047f33988a
TrueForms1
NullTrueAllEXCEPTION MESSAGE
1160d151c0854eadb54ca79a76eab017_debug.ff4150cf-63c8-4e12-b3ff-cd047f33988a
FalseNullEXCEPTION MESSAGE


Common Errors

Debug entity with id = '' not found

If the debug id is null or empty, the step will cause an error.

To correct this, ensure that the Debug Id is entered or mapped correctly.

Exception Message:

Exception Stack Trace: DecisionsFramework.Design.Flow.ErrorRunningFlowStep: Error running step Get Number Of Sub Contexts 1[GetNumberOfSubContexts] in flow [Flow 6]: Exception invoking method GetNumberOfSubContexts on class DebuggerSteps
 ---> DecisionsFramework.LoggedException: Exception invoking method GetNumberOfSubContexts on class DebuggerSteps
 ---> System.InvalidOperationException: Debug entity with id = '' not found.
 at DecisionsFramework.Design.Flow.Service.Debugging.DebugData.DebugDataStorage.Retrieve(String id, Boolean failIfNotFound
 at DecisionsFramework.Design.Flow.Service.Debugging.DebugData.DebuggerSteps.GetNumberOfSubContexts(String debugId, DebuggerStepContextType subContextType, Boolean onlyChildren)
   --- End of inner exception stack trace --- at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data
 at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData
 at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)
   --- End of inner exception stack trace ---


Parameter 'subContextType' of 'GetNumberOfSubContexts' can not be null

If the Sub Context Type value is null or empty, the step will cause an error.

To correct this, ensure that the Sub Context type is specified using a Constant mapping and selecting one of the options. 

Exception Message:

Exception Stack Trace: DecisionsFramework.BusinessRuleException: [BusinessRule] Parameter 'subContextType' of 'GetNumberOfSubContexts' can not be null 
at DecisionsFramework.Design.Flow.CoreSteps.InvokeMethodUtility.ThrowErrorIfNullIsNotAllowed(MethodInfo methodInfo, Object[] parameterValues, String errorMessage
 at DecisionsFramework.Design.Flow.StepImplementations.InvokeMethodStep.Run(StepStartData data
 at DecisionsFramework.Design.Flow.FlowStep.RunStepInternal(String flowTrackingID, String stepTrackingID, KeyValuePairDataStructure[] stepRunDataValues, AbstractFlowTrackingData trackingData
 at DecisionsFramework.Design.Flow.FlowStep.Start(String flowTrackingID, String stepTrackingID, FlowStateData data, AbstractFlowTrackingData trackingData, RunningStepData currentStepData)




Was this article helpful?