public void AllReservedColumnsActivityMatrixQueryParamTest() { IWfProcessDescriptor processDesp = ProcessHelper.GetDynamicProcessDesp(ActivityMatrixHelper.PrepareReservedActivityMatrixResourceDescriptor()); IWfProcess process = ProcessHelper.StartupProcess(processDesp, new Dictionary <string, object>()); IWfActivityDescriptor normalActDesp = processDesp.Activities["NormalActivity"]; WfActivityMatrixResourceDescriptor resource = (WfActivityMatrixResourceDescriptor)normalActDesp.Resources[0]; SOARoleContext context = SOARoleContext.CreateContext(resource.PropertyDefinitions, process); context.QueryParams.Output(); }
public void ActivityMatrixQueryParamMismatchProcessTest() { IWfProcessDescriptor processDesp = ProcessHelper.GetDynamicProcessDesp(); IWfProcess process = ProcessHelper.StartupProcess(processDesp, new Dictionary <string, object>()); IWfActivityDescriptor normalActDesp = processDesp.Activities["NormalActivity"]; WfActivityMatrixResourceDescriptor resource = (WfActivityMatrixResourceDescriptor)normalActDesp.Resources[0]; SOARoleContext context = SOARoleContext.CreateContext(resource.PropertyDefinitions, process); context.QueryParams.Output(); Assert.AreEqual(3, context.QueryParams.Count); Assert.IsNull(context.QueryParams[0].QueryValue); Assert.IsNull(context.QueryParams[1].QueryValue); Assert.IsNull(context.QueryParams[2].QueryValue); }
private static SOARoleContext PrepareRoleContext(IRole role, object callerContext) { SOARoleContext result = null; if (callerContext is WfConditionDescriptor) { WfConditionDescriptor condition = (WfConditionDescriptor)callerContext; IWfProcess process = null; if (condition.Owner != null) { process = condition.Owner.ProcessInstance; } result = SOARoleContext.CreateContext(role, process); } return(result); }
public void ApprovalMatrixQueryParamMismatchProcessTest() { WfApprovalMatrix approvalMatrix = ApprovalMatrixHelper.PrepareApprovalMatrix(); WfApprovalMatrixAdapter.Instance.Update(approvalMatrix); IWfProcessDescriptor processDesp = ProcessHelper.GetDynamicProcessDesp(approvalMatrix.ID); IWfProcess process = ProcessHelper.StartupProcess(processDesp, new Dictionary <string, object>() { { "PayMethod", "1" }, { "Age", 30 } }); SOARoleContext context = SOARoleContext.CreateContext(approvalMatrix.PropertyDefinitions, process); context.QueryParams.Output(); Assert.AreEqual(1, context.QueryParams.Count); Assert.IsNull(context.QueryParams[0].QueryValue); }