Exemple #1
0
        public void PersistQueueBasicTest()
        {
            IWfProcess process = ProcessHelper.CreateSimpleProcessDescriptor().StartupProcess();

            ProcessHelper.OutputExecutionTime(() => WfRuntime.PersistWorkflows(), "保存简单流程");

            WfPersistQueue pq = WfPersistQueue.FromProcess(process);

            Console.WriteLine(pq.ProcessID);

            Assert.AreEqual(0, WfProcessCurrentAssigneeAdapter.Instance.Load(pq.ProcessID).Count);
            Assert.AreEqual(0, WfProcessRelativeParamsAdapter.Instance.Load(pq.ProcessID).Count);
            Assert.IsNull(WfProcessDimensionAdapter.Instance.Load(pq.ProcessID));

            WfPersistQueueAdapter.Instance.DoQueueOperation(pq);

            Assert.IsTrue(WfProcessCurrentAssigneeAdapter.Instance.Load(pq.ProcessID).Count > 0);
            Assert.AreEqual(process.RelativeParams.Count, WfProcessRelativeParamsAdapter.Instance.Load(pq.ProcessID).Count);

            WfProcessDimension pd = WfProcessDimensionAdapter.Instance.Load(pq.ProcessID);

            Assert.IsNotNull(pd);

            Console.WriteLine(pd.Data);
        }
Exemple #2
0
        public void FetchPersistQueueTest()
        {
            WfPersistQueueAdapter.Instance.ClearQueue();
            WfPersistQueueAdapter.Instance.ClearArchivedQueue();

            IWfProcess process = ProcessHelper.CreateSimpleProcessDescriptor().StartupProcess();

            ProcessHelper.OutputExecutionTime(() => WfRuntime.PersistWorkflows(), "保存简单流程");

            Assert.AreEqual(0, WfProcessCurrentAssigneeAdapter.Instance.Load(process.ID).Count);
            Assert.AreEqual(0, WfProcessRelativeParamsAdapter.Instance.Load(process.ID).Count);
            Assert.IsNull(WfProcessDimensionAdapter.Instance.Load(process.ID));

            Console.WriteLine(process.ID);

            WfPersistQueue pq = WfPersistQueueAdapter.Instance.FetchQueueItemsAndDoOperation(1).FirstOrDefault();

            Assert.IsTrue(WfProcessCurrentAssigneeAdapter.Instance.Load(pq.ProcessID).Count > 0);
            Assert.AreEqual(process.RelativeParams.Count, WfProcessRelativeParamsAdapter.Instance.Load(pq.ProcessID).Count);

            Assert.IsNull(WfPersistQueueAdapter.Instance.Load(pq.ProcessID));

            WfPersistQueue pqArchieved = WfPersistQueueAdapter.Instance.LoadArchived(pq.ProcessID);

            Assert.IsNotNull(pqArchieved);
            Assert.AreEqual(pq.UpdateTag, pqArchieved.UpdateTag);

            WfProcessDimension pd = WfProcessDimensionAdapter.Instance.Load(pq.ProcessID);

            Assert.IsNotNull(pd);

            Console.WriteLine(pd.Data);
        }
Exemple #3
0
        public void SaveData(IWfProcess process, Dictionary <object, object> context)
        {
            WfProcessDimension pd = WfProcessDimension.FromProcess(process);

            WfProcessDimensionAdapter.Instance.Update(pd);
        }