private static string PrepareNextStepsSelectorsString(IEnumerable <IWfTransitionDescriptor> transitions, WfTransferParamsBase transferParams) { WfClientNextStepCollection nextSteps = new WfClientNextStepCollection(); foreach (IWfTransitionDescriptor transition in transitions) { WfClientNextStep nextStep = new WfClientNextStep(); nextStep.TransitionKey = transition.Key; nextStep.TransitionName = transition.Name; nextStep.TransitionDescription = transition.Description; nextStep.ActivityKey = transition.ToActivity.Key; nextStep.ActivityName = transition.ToActivity.Name; nextStep.ActivityDescription = transition.ToActivity.Description; nextSteps.Add(nextStep); } if (transferParams != null && transferParams.FromTransitionDescriptor != null) { nextSteps.SelectedKey = transferParams.FromTransitionDescriptor.Key; } XElement nextStepsRoot = new XElement("NextSteps"); nextSteps.ToXElement(nextStepsRoot); return(nextStepsRoot.ToString()); }
public void WfClientNextStepToXElementTest() { WfClientNextStepCollection expected = PrepareNextSteps(); XElement root = new XElement("NextSteps"); expected.ToXElement(root); Console.WriteLine(root.ToString()); WfClientNextStepCollection actual = new WfClientNextStepCollection(root); AreSame(expected, actual); Assert.AreEqual(expected.SelectedKey, actual.GetSelectedStep().TransitionKey); }
public void ClientOpinionExtraDataTest() { WfClientOpinion client = PrepareClientOpinion(); WfClientNextStepCollection nextSteps = WfClientNextStepTest.PrepareNextSteps(); WfClientNextStep expectedNextStep = nextSteps.GetSelectedStep(); Dictionary <string, object> extraData = new Dictionary <string, object>(); XElement root = new XElement("NextSteps"); nextSteps.ToXElement(root); extraData["NextSteps"] = root.ToString(); client.FillExtraDataFromDictionary(extraData); Console.WriteLine("意见结果:{0}", client.GetNextSteps().GetSelectedStep().GetDescription()); WfClientNextStepTest.AreSame(expectedNextStep, client.GetNextSteps().GetSelectedStep()); }
private static string PrepareAbortProcessNextStepsString() { WfClientNextStepCollection nextSteps = new WfClientNextStepCollection(); WfClientNextStep nextStep = new WfClientNextStep(); nextStep.TransitionKey = "AbortProcess"; nextStep.TransitionName = "作废"; nextStep.TransitionDescription = "作废"; nextStep.ActivityKey = "AbortProcess"; nextStep.ActivityName = "作废"; nextStep.ActivityDescription = "作废"; nextSteps.Add(nextStep); nextSteps.SelectedKey = "AbortProcess"; XElement nextStepsRoot = new XElement("NextSteps"); nextSteps.ToXElement(nextStepsRoot); return(nextStepsRoot.ToString()); }
private static string PrepareAbortProcessNextStepsString() { WfClientNextStepCollection nextSteps = new WfClientNextStepCollection(); WfClientNextStep nextStep = new WfClientNextStep(); nextStep.TransitionKey = "AbortProcess"; nextStep.TransitionName = "作废"; nextStep.TransitionDescription = "作废"; nextStep.ActivityKey = "AbortProcess"; nextStep.ActivityName = "作废"; nextStep.ActivityDescription = "作废"; nextSteps.Add(nextStep); nextSteps.SelectedKey = "AbortProcess"; XElement nextStepsRoot = new XElement("NextSteps"); nextSteps.ToXElement(nextStepsRoot); return nextStepsRoot.ToString(); }
private static string PrepareNextStepsSelectorsString(IEnumerable<IWfTransitionDescriptor> transitions, WfTransferParamsBase transferParams) { WfClientNextStepCollection nextSteps = new WfClientNextStepCollection(); foreach (IWfTransitionDescriptor transition in transitions) { WfClientNextStep nextStep = new WfClientNextStep(); nextStep.TransitionKey = transition.Key; nextStep.TransitionName = transition.Name; nextStep.TransitionDescription = transition.Description; nextStep.ActivityKey = transition.ToActivity.Key; nextStep.ActivityName = transition.ToActivity.Name; nextStep.ActivityDescription = transition.ToActivity.Description; nextSteps.Add(nextStep); } if (transferParams != null && transferParams.FromTransitionDescriptor != null) nextSteps.SelectedKey = transferParams.FromTransitionDescriptor.Key; XElement nextStepsRoot = new XElement("NextSteps"); nextSteps.ToXElement(nextStepsRoot); return nextStepsRoot.ToString(); }