Beispiel #1
0
        private List <DebugShape> flattenShape(ShapeInfo shape, FlatteningPrefixType prefixType, string currentPrefix)
        {
            List <DebugShape> result = new List <DebugShape>();


            foreach (ShapeInfo child in shape.children.FindAll(si => si.shapeType != ShapeTypes.DNFPredicateShape &&
                                                               si.shapeType != ShapeTypes.MessageAssignmentShape &&
                                                               si.shapeType != ShapeTypes.TransformShape &&
                                                               si.shapeType != ShapeTypes.MessageDeclarationShape &&
                                                               si.shapeType != ShapeTypes.MessageRefShape &&
                                                               si.shapeType != ShapeTypes.MessagePartRefShape &&
                                                               si.shapeType != ShapeTypes.VariableDeclarationShape &&
                                                               si.shapeType != ShapeTypes.RulesParameterRefShape &&
                                                               si.shapeType != ShapeTypes.CorrelationDeclarationShape &&
                                                               si.shapeType != ShapeTypes.StatementRefShape &&
                                                               si.shapeType != ShapeTypes.ParameterShape))
            {
                DebugShape ds = new DebugShape();
                ds.RepeatCount = 1;
                ds.ShapeID     = child.ShapeID;
                ds.shapeText   = currentPrefix + child.shapeText;
                ds.shapeType   = child.shapeType;
                ds.Completed   = true;

                string prefix = String.Empty;
                switch (prefixType)
                {
                case FlatteningPrefixType.Indentation:
                    prefix = currentPrefix + " - ";
                    break;

                case FlatteningPrefixType.ParentName:
                    prefix = currentPrefix + String.Format("[{0}] ", child.shapeText);
                    break;

                default:
                    break;
                }

                result.Add(ds);
                result.AddRange(this.flattenShape(child, prefixType, prefix));
            }

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Used to convert the ProcessFlow (ie: orchestration definition) to a DebugTrace
        /// (ie: trace generated by BizTalk when executing an instance of the orchestration)
        /// </summary>
        /// <returns></returns>
        public DebugTrace Flatten(FlatteningPrefixType prefixType)
        {
            DebugTrace result = new DebugTrace();

            foreach (ShapeInfo shape in this.children.FindAll(si => si.shapeType != ShapeTypes.DNFPredicateShape &&
                                                              si.shapeType != ShapeTypes.MessageAssignmentShape &&
                                                              si.shapeType != ShapeTypes.TransformShape &&
                                                              si.shapeType != ShapeTypes.MessageDeclarationShape &&
                                                              si.shapeType != ShapeTypes.MessageRefShape &&
                                                              si.shapeType != ShapeTypes.MessagePartRefShape &&
                                                              si.shapeType != ShapeTypes.VariableDeclarationShape &&
                                                              si.shapeType != ShapeTypes.RulesParameterRefShape &&
                                                              si.shapeType != ShapeTypes.CorrelationDeclarationShape &&
                                                              si.shapeType != ShapeTypes.StatementRefShape &&
                                                              si.shapeType != ShapeTypes.ParameterShape))
            {
                DebugShape ds = new DebugShape();
                ds.RepeatCount = 1;
                ds.ShapeID     = shape.ShapeID;
                ds.shapeText   = shape.shapeText;
                ds.shapeType   = shape.shapeType;
                ds.Completed   = true;

                string prefix = String.Empty;
                switch (prefixType)
                {
                case FlatteningPrefixType.Indentation:
                    prefix = " - ";
                    break;

                case FlatteningPrefixType.ParentName:
                    prefix = String.Format("[{0}] ", shape.shapeText);
                    break;

                default:
                    break;
                }

                result.TraceDetails.Add(ds);
                result.TraceDetails.AddRange(this.flattenShape(shape, prefixType, prefix));
            }

            return(result);
        }