Пример #1
0
        static void Test()
        {
            SchemaMaster master = new SchemaMaster();

            master.TypeName                     = AssemblyUtil.GetTypeString(typeof(SequentialWorkflowInstanceFactory));
            master.InstanceFactory              = new SequentialWorkflowInstanceFactory();
            master.Description.Id               = Guid.NewGuid();
            master.Description.Name             = "Agreement";
            master.Description.Creator          = "Mediachase";
            master.Description.Icon             = string.Empty;
            master.Description.Comment          = string.Empty;
            master.Description.UI.CreateControl = string.Empty;
            master.Description.UI.EditControl   = string.Empty;
            master.Description.UI.ViewControl   = string.Empty;

            ActivityMaster create = new ActivityMaster();

            create.TypeName = AssemblyUtil.GetTypeString(typeof(CreateAssignmentAndWaitResultActivityInstanceFactory));
            CreateAssignmentAndWaitResultActivityInstanceFactory ifact = new CreateAssignmentAndWaitResultActivityInstanceFactory();

            ifact.AssignmentProperties = new PropertyValueCollection();
            ifact.AssignmentProperties.Add(new PropertyValue("Subject", "Test Subject"));
            ifact.AssignmentProperties.Add(new PropertyValue("UserId", 12));

            create.InstanceFactory = ifact;

            create.Description.Name             = "AgreeWith";
            create.Description.Icon             = string.Empty;
            create.Description.Comment          = string.Empty;
            create.Description.UI.CreateControl = string.Empty;
            create.Description.UI.EditControl   = string.Empty;
            create.Description.UI.ViewControl   = string.Empty;


            ActivityMaster block = new ActivityMaster();

            block.TypeName                     = AssemblyUtil.GetTypeString(typeof(BlockActivityInstanceFactory));
            block.InstanceFactory              = new BlockActivityInstanceFactory();
            block.Description.Name             = "AgreementBlock";
            block.Description.Icon             = string.Empty;
            block.Description.Comment          = string.Empty;
            block.Description.UI.CreateControl = string.Empty;
            block.Description.UI.EditControl   = string.Empty;
            block.Description.UI.ViewControl   = string.Empty;

            master.Description.Activities.Add(create);
            master.Description.Activities.Add(block);

            master.Description.SupportedIbnObjectTypes.Add(16);

            string xml = McXmlSerializer.GetString <SchemaMaster>(master, typeof(SequentialWorkflowInstanceFactory),
                                                                  typeof(CreateAssignmentAndWaitResultActivityInstanceFactory),
                                                                  typeof(BlockActivityInstanceFactory));
        }
Пример #2
0
        static void Test()
        {
            SchemaMaster master = new SchemaMaster();

            master.TypeName = AssemblyUtil.GetTypeString(typeof(SequentialWorkflowInstanceFactory));
            master.InstanceFactory = new SequentialWorkflowInstanceFactory();
            master.Description.Id = Guid.NewGuid();
            master.Description.Name = "Agreement";
            master.Description.Creator = "Mediachase";
            master.Description.Icon = string.Empty;
            master.Description.Comment = string.Empty;
            master.Description.UI.CreateControl = string.Empty;
            master.Description.UI.EditControl = string.Empty;
            master.Description.UI.ViewControl = string.Empty;

            ActivityMaster create = new ActivityMaster();
            create.TypeName = AssemblyUtil.GetTypeString(typeof(CreateAssignmentAndWaitResultActivityInstanceFactory));
            CreateAssignmentAndWaitResultActivityInstanceFactory ifact = new CreateAssignmentAndWaitResultActivityInstanceFactory();
            ifact.AssignmentProperties = new PropertyValueCollection();
            ifact.AssignmentProperties.Add(new PropertyValue("Subject", "Test Subject"));
            ifact.AssignmentProperties.Add(new PropertyValue("UserId", 12));

            create.InstanceFactory = ifact;

            create.Description.Name = "AgreeWith";
            create.Description.Icon = string.Empty;
            create.Description.Comment = string.Empty;
            create.Description.UI.CreateControl = string.Empty;
            create.Description.UI.EditControl = string.Empty;
            create.Description.UI.ViewControl = string.Empty;

            ActivityMaster block = new ActivityMaster();
            block.TypeName = AssemblyUtil.GetTypeString(typeof(BlockActivityInstanceFactory));
            block.InstanceFactory = new BlockActivityInstanceFactory();
            block.Description.Name = "AgreementBlock";
            block.Description.Icon = string.Empty;
            block.Description.Comment = string.Empty;
            block.Description.UI.CreateControl = string.Empty;
            block.Description.UI.EditControl = string.Empty;
            block.Description.UI.ViewControl = string.Empty;

            master.Description.Activities.Add(create);
            master.Description.Activities.Add(block);

            master.Description.SupportedIbnObjectTypes.Add(16);

            string xml = McXmlSerializer.GetString<SchemaMaster>(master, typeof(SequentialWorkflowInstanceFactory),
                        typeof(CreateAssignmentAndWaitResultActivityInstanceFactory),
                        typeof(BlockActivityInstanceFactory));
        }