/// <summary> /// Analyzes the step and returns the external edge for that resume step. /// </summary> /// <param name="stepDescription">The description of a resume step.</param> /// <param name="resumeStepNumber">The step number of the given resume step.</param> /// <returns>The external edge for the given resume step.</returns> public static ExternalEdge GetExternalEdgeForResumeStep(string stepDescription, int resumeStepNumber) { Regex resumeRegex = new Regex(GraphBuilder.GetMatchingPatternForStepType(stepDescription, StepType.Resume)); Match resumeMatch = resumeRegex.Match(stepDescription); // Decrease by one because in the description the first step is numbered 1 but points to the index 0 in the list. int targetStepInBasicFlow = int.Parse(resumeMatch.Groups[1].Value) - 1; return(new ExternalEdge(resumeStepNumber, new ReferenceStep(new FlowIdentifier(FlowType.Basic, 0), targetStepInBasicFlow))); }
/// <summary> /// Tests if a string is equal to at least one keyword associated with the specified step type. /// </summary> /// <param name="testString">The string to test.</param> /// <param name="stepType">The type specifying the patterns.</param> /// <returns>If at least one pattern for the step type matches to the test string.</returns> public static bool IsEqualsToAtLeastOnePatternOfStepType(this string testString, StepType stepType) { return(GraphBuilder.GetMatchingPatternForStepType(testString, stepType) != null); }