コード例 #1
0
        public void Init()
        {
            CleanUp();
            model = new WorkflowDefinitionModel
            {
                Value = new WorkflowDefinition
                {
                    ID      = "unittest1",
                    Name    = "unit test 1",
                    Enabled = 1,
                    Creator = "frank",
                },
            };
            ActivityDefinitionModel activity1 = new ActivityDefinitionModel
            {
                Value = new ActivityDefinition
                {
                    ID      = "unittestactivity1",
                    Name    = "activity1",
                    Page    = "page1",
                    Title   = "title1",
                    Creator = "frank",
                    WorkflowDefinitionID = "unittest1",
                    Type    = 1,
                    Enabled = 1,
                }
            };
            ActivityDefinitionModel activity2 = new ActivityDefinitionModel
            {
                Value = new ActivityDefinition
                {
                    ID      = "unittestactivity2",
                    Name    = "activity2",
                    Page    = "page2",
                    Title   = "title2",
                    Creator = "frank",
                    WorkflowDefinitionID = "unittest1",
                    Enabled = 1,
                    Type    = 1,
                }
            };

            ActivityDefinitionModel activity3 = new ActivityDefinitionModel
            {
                Value = new ActivityDefinition
                {
                    ID      = "unittestactivity3",
                    Name    = "activity3",
                    Page    = "page3",
                    Title   = "title3",
                    Creator = "frank",
                    WorkflowDefinitionID = "unittest1",
                    Type    = 1,
                    Enabled = 1,
                }
            };
            LinkDefinitionModel link1 = new LinkDefinitionModel
            {
                Value = new LinkDefinition
                {
                    ID   = "unittestlink1",
                    Name = "link1",
                    FromActivityDefinitionID = "unittestactivity1",
                    ToActivityDefinitionID   = "unittestactivity2",
                    WorkflowDefinitionID     = "unittest1",
                },
                FromActivityDefinition = activity1,
                ToActivityDefinition   = activity2,
            };
            LinkDefinitionModel link2 = new LinkDefinitionModel
            {
                Value = new LinkDefinition
                {
                    ID   = "unittestlink2",
                    Name = "link2",
                    FromActivityDefinitionID = "unittestactivity2",
                    ToActivityDefinitionID   = "unittestactivity3",
                    WorkflowDefinitionID     = "unittest1",
                },
                FromActivityDefinition = activity2,
                ToActivityDefinition   = activity3,
            };

            model.Root = activity1;
            model.Save();
        }
コード例 #2
0
        public void Init()
        {
            CleanUp();
            model = new WorkflowDefinitionModel
            {
                Value = new WorkflowDefinition
                {
                    ID = "unittest1",
                    Name = "unit test 1",
                    Enabled = 1,
                    Creator = "frank",
                },

            };
            ActivityDefinitionModel activity1 = new ActivityDefinitionModel
            {
                Value = new ActivityDefinition
                {
                    ID = "unittestactivity1",
                    Name = "activity1",
                    Page = "page1",
                    Title = "title1",
                    Creator = "frank",
                    WorkflowDefinitionID = "unittest1",
                    Type = 1,
                    Enabled = 1,
                }
            };
            ActivityDefinitionModel activity2 = new ActivityDefinitionModel
            {
                Value = new ActivityDefinition
                {
                    ID = "unittestactivity2",
                    Name = "activity2",
                    Page = "page2",
                    Title = "title2",
                    Creator = "frank",
                    WorkflowDefinitionID = "unittest1",
                    Enabled = 1,
                    Type = 1,
                }
            };

            ActivityDefinitionModel activity3 = new ActivityDefinitionModel
            {
                Value = new ActivityDefinition
                {
                    ID = "unittestactivity3",
                    Name = "activity3",
                    Page = "page3",
                    Title = "title3",
                    Creator = "frank",
                    WorkflowDefinitionID = "unittest1",
                    Type = 1,
                    Enabled = 1,
                }
            };
            LinkDefinitionModel link1 = new LinkDefinitionModel
            {
                Value = new LinkDefinition
                {
                    ID = "unittestlink1",
                    Name = "link1",
                    FromActivityDefinitionID = "unittestactivity1",
                    ToActivityDefinitionID = "unittestactivity2",
                    WorkflowDefinitionID = "unittest1",
                },
                FromActivityDefinition = activity1,
                ToActivityDefinition = activity2,
            };
            LinkDefinitionModel link2 = new LinkDefinitionModel
            {
                Value = new LinkDefinition
                {
                    ID = "unittestlink2",
                    Name = "link2",
                    FromActivityDefinitionID = "unittestactivity2",
                    ToActivityDefinitionID = "unittestactivity3",
                    WorkflowDefinitionID = "unittest1",
                },
                FromActivityDefinition = activity2,
                ToActivityDefinition = activity3,
            };
            model.Root = activity1;
            model.Save();
        }