Example #1
0
        public void CreateNewWorkflow()
        {
            SequentialWorkflowActivity rootActivity = new SequentialWorkflowActivity("root");

            rootActivity.SetValue(WorkflowMarkupSerializer.XClassProperty, WorkflowTypeFactory.GetWorkflowClassFullName(Workflow));

            StringBuilder sb = new StringBuilder();

            XmlWriter xmlWriter = XmlWriter.Create(sb);
            WorkflowMarkupSerializer serializer = new WorkflowMarkupSerializer();

            serializer.Serialize(xmlWriter, rootActivity);
            xmlWriter.Close();
            Workflow.WorkflowXoml = sb.ToString();
            //Check out the created workflow
            CheckOutInObject(Workflow, true);
        }
        public void CreateNewWorkflow(Module module)
        {
            workflow             = new Cdc.MetaManager.DataAccess.Domain.Workflow();
            workflow.RequestMap  = new PropertyMap();
            workflow.Name        = tbName.Text;
            workflow.Module      = module;
            workflow.Description = tbDescription.Text;

            SequentialWorkflowActivity rootActivity = new SequentialWorkflowActivity("root");

            rootActivity.SetValue(WorkflowMarkupSerializer.XClassProperty, WorkflowTypeFactory.GetWorkflowClassFullName(workflow));

            StringBuilder sb = new StringBuilder();

            XmlWriter xmlWriter = XmlWriter.Create(sb);
            WorkflowMarkupSerializer serializer = new WorkflowMarkupSerializer();

            serializer.Serialize(xmlWriter, rootActivity);
            xmlWriter.Close();
            workflow.WorkflowXoml = sb.ToString();
        }