Exemplo n.º 1
0
        /// <summary>
        /// Create the WIT in XML and all the underlying subelements
        /// </summary>
        private void CreateWorkItemType()
        {
            Logger.EnteredMethod(LogSource.CQ);

            WorkItemType wit = new WorkItemType();

            wit.name = CQWrapper.GetEntityDefName(cqEntityDef);

            // set the WIT
            witdSchema.SetWorkItemType(wit);

            wit.FORM = new Form();

            // add Fields to this WIT
            ProcessFields(wit);

            // add Workflow to WIT
            switch (CQWrapper.GetEntityDefType(cqEntityDef))
            {
            case CQConstants.STATE_BASED:
            case CQConstants.STATE_OR_STATELESS:
            {
                Logger.Write(LogSource.CQ, TraceLevel.Info, "Workflow is either State Based or Stateless");
                ProcessWorkflow(wit);
                break;
            }

            case CQConstants.STATE_LESS:
            {
                // whatever is the type of state we have to generate the workflow information
                // as that is mandatory as per the XSD file rules.. so a dummy block for Workflow
                // will be generated
                Logger.Write(LogSource.CQ, TraceLevel.Info, "Workflow is Stateless. Adding Dummy Workflow");

                wit.WORKFLOW = new Workflow();
                CreateDummyWorkflow(wit.WORKFLOW);
                break;
            }
            }

            Logger.ExitingMethod(LogSource.CQ);
        }