public void SetUp() { theInstruction = new BeginWhen(); theSettings = new HistorySettings(); theServices = new InMemoryServiceLocator(); theServices.Add(theSettings); theServices.Add <IActEntryConditionRegistry>(new ActEntryConditionRegistry()); theContext = new ActEntryConditionContext(new WorkflowObject(), theServices); }
private void executeInstruction(Action action) { var context = new ActEntryConditionContext(_workflowObject, _services); if (_ignores.All(instruction => instruction.ShouldExecute(context))) { action(); } }
private void executeInstruction(Action action) { var authorized = _privileges.All(_user.HasPermission); var context = new ActEntryConditionContext(_workflowObject, _services); if (authorized && _ignores.All(instruction => instruction.ShouldExecute(context))) { action(); } }
public bool ExecuteCondition(ActEntryConditionContext context) { var name = Condition.Resolve(context.Services).ToString(); var registry = context.Service <IActEntryConditionRegistry>(); if (!registry.HasCondition(name)) { throw new ModelMapException("Could not find condition: \"{0}\"".ToFormat(name)); } var type = registry.FindCondition(name); var condition = (IActEntryCondition)FastYetSimpleTypeActivator.CreateInstance(type); return(condition.ShouldExecute(context)); }
public bool ShouldExecute(ActEntryConditionContext context) { if (Condition != null) { return(ExecuteCondition(context)); } if (IsChild.HasValue) { return(IsChild.Value == context.WorkflowObject.IsChild); } if (!MergeCaseHistory.HasValue) { return(true); } return(MergeCaseHistory.Value == context.Settings.MergeCaseHistoryChildSubcases); }
public bool ShouldExecute(ActEntryConditionContext conditionContext) { return(Value); }