private static IWorkflowNode CompressSequence(WorkflowParser.ActivitySequence sequence) { var nodes = new List <IWorkflowNode>(); nodes.AddRange(CompressVariableCollection(sequence.Variables)); nodes.AddRange(CompressActivityCollection(sequence.Activities)); return(new ActivityList(nodes.ToArray())); }
private static IWorkflowNode CompressRollUp(WorkflowParser.ActivitySequence sequence) { var activites = sequence.Activities; var hierarchicalRelationshipName = (activites[0] as WorkflowParser.ActivitySequence).Variables[0].Default.TrimEdge(); var filterResult = (activites[1] as WorkflowParser.ActivitySequence).Variables != null ? (activites[1] as WorkflowParser.ActivitySequence).Variables[0].Name : null; var aggregateResult = (activites[2] as WorkflowParser.ActivitySequence).Variables[0].Name; var filter = new List <IWorkflowNode>(); filter.AddRange(CompressVariableCollection((activites[1] as WorkflowParser.ActivitySequence).Variables)); filter.AddRange(CompressActivityCollection((activites[1] as WorkflowParser.ActivitySequence).Activities)); var aggregation = new List <IWorkflowNode>(); aggregation.AddRange(CompressVariableCollection((activites[2] as WorkflowParser.ActivitySequence).Variables)); aggregation.AddRange(CompressActivityCollection((activites[2] as WorkflowParser.ActivitySequence).Activities)); return(new RollUp(hierarchicalRelationshipName, filterResult, aggregateResult, filter, aggregation)); }