상속: SenseNet.Workflow.WorkflowHandlerBase
예제 #1
0
        public void WF_WaitForMultipleContent_All()
        {
            Content content;
            var     paths = new string[3];
            var     nodes = new Node[3];

            for (int i = 0; i < paths.Length; i++)
            {
                paths[i] = RepositoryPath.Combine(TestRoot.Path, "Car" + i);
                if (Node.Exists(paths[i]))
                {
                    Node.ForceDelete(paths[i]);
                }
                content  = Content.CreateNew("Car", TestRoot, "Car" + i); content.Save();
                nodes[i] = content.ContentHandler;
            }

            var wfContent = new WaitForMultipleContentWorkflow(TestRoot);

            wfContent.Triggers   = nodes;
            wfContent.WaitForAll = true;
            wfContent.Save();
            wfContent = Node.Load <WaitForMultipleContentWorkflow>(wfContent.Id);

            InstanceManager.Start(wfContent);

            for (int i = 0; i < paths.Length; i++)
            {
                var car = Node.LoadNode(paths[i]);
                car.Index++;
                car.Save();
            }

            string msg;

            if (!WfWatcher.WaitForFinished(out msg))
            {
                Assert.Inconclusive("#2");
            }
            Assert.IsTrue(msg == "Finished", String.Concat("Received message: '", msg, "'. Expected: 'Finished'"));
        }
예제 #2
0
        public void WF_WaitForMultipleContent_All()
        {
            Content content;
            var paths = new string[3];
            var nodes = new Node[3];
            for (int i = 0; i < paths.Length; i++)
            {
                paths[i] = RepositoryPath.Combine(TestRoot.Path, "Car" + i);
                if (Node.Exists(paths[i]))
                    Node.ForceDelete(paths[i]);
                content = Content.CreateNew("Car", TestRoot, "Car" + i); content.Save();
                nodes[i] = content.ContentHandler;
            }

            var wfContent = new WaitForMultipleContentWorkflow(TestRoot);
            wfContent.Triggers = nodes;
            wfContent.WaitForAll = true;
            wfContent.Save();
            wfContent = Node.Load<WaitForMultipleContentWorkflow>(wfContent.Id);

            InstanceManager.Start(wfContent);

            for (int i = 0; i < paths.Length; i++)
            {
                var car = Node.LoadNode(paths[i]);
                car.Index++;
                car.Save();
            }

            string msg;
            if (!WfWatcher.WaitForFinished(out msg))
                Assert.Inconclusive("#2");
            Assert.IsTrue(msg == "Finished", String.Concat("Received message: '", msg, "'. Expected: 'Finished'"));
        }