Ejemplo n.º 1
0
 SetState <TWf>(this IFluentConfigurator <IWorkflowConditionalObject <TWf> > t, Func <Workflow <TWf> .State> getter)
     where TWf : NotifierBase, IWorkflow <TWf>
 {
     return(t
            .Action(w =>
     {
         w.SetState(getter);
     }));
 }
 SetState <TWf>(this IFluentConfigurator <IWorkflowConditionalObject <TWf> > t, Func <Workflow <TWf> .State> getter)
     where TWf : NotifierBase, IWorkflow <TWf>
 {
     return(t
            .Action(async w =>
     {
         await w.SetStateAsync(getter, "", "", false, false);
     }));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Define target stage for a workflow element
 /// </summary>
 /// <typeparam name="TWf"></typeparam>
 /// <param name="c"></param>
 /// <param name="getStage"></param>
 /// <returns></returns>
 public static IFluentConfigurator <IWorkflowConditionalObject <TWf> > ToStage <TWf>(this IFluentConfigurator <IWorkflowConditionalObject <TWf> > c, Func <TWf, Workflow <TWf> .Stage> getStage)
     where TWf : class, IWorkflow <TWf>
 {
     if (c.Target is Workflow <TWf> .Action action)
     {
         c.WhenStageAllowed(getStage);
         c.Action(async w => await w.SetStageAsync(() => getStage(w), action.GetCaption(w), action.GetIconPath(w), action.SigningMandatory, action.MotivationMandatory));
         return(c);
     }
     return(c);
 }