Exemplo n.º 1
0
 protected override void OnAwaitingAction(IAction_ action, Application workflow, Opt <Result <ActionResponse> > response, Lead evaluationCtx)
 {
     // If we DONT have a response, do some IO to get the response we need.
     // Else we already have a predefined response for this action, so we dont need to do any IO, and just
     // receive the predefined response
     if (response.IsNone)
     {
         var sendResult = _messageSvc.SendMessage(action.MessageText, workflow.MobileNo).Map(_ => action.MessageText);
         action.MarkAsActioned(sendResult, Participant.User, UtcDateTime.Now, evaluationCtx);
     }
     else
     {
         action.MarkAsActioned(Ok(action.MessageText), Participant.User, UtcDateTime.Now, evaluationCtx);
         OnAwaitingResponse(action, workflow, response, evaluationCtx);
     }
 }
                protected override void OnAwaitingAction(IAction_ action, Application workflow, Opt <Result <ActionResponse> > response, Lead evaluationCtx)
                {
                    // If we DONT have a response, do some IO to get the response we need.
                    // Else we already have a predefined response for this action, so we dont need to do any IO, and just
                    // receive the predefined response
                    if (response.IsNone)
                    {
                        Console.WriteLine(action.MessageText);
                        action.MarkAsActioned(Ok(action.MessageText), Participant.User, UtcDateTime.Now, evaluationCtx);

                        var text = Console.ReadLine();
                        OnAwaitingResponse(action, workflow, Some(Ok((ActionResponse) new ReceiveMessageResponseActionResponse(new ReceiveMessageResponse("", "", text)))), evaluationCtx);
                    }
                    else
                    {
                        action.MarkAsActioned(Ok(action.MessageText), Participant.User, UtcDateTime.Now, evaluationCtx);
                        OnAwaitingResponse(action, workflow, response, evaluationCtx);
                    }
                }
 protected override void OnAwaitingAction(IAction_ action, Application workflow, Opt <Result <ActionResponse> > response, Lead evaluationCtx)
 {
     Console.WriteLine(action.MessageText);
     action.MarkAsActioned(Ok(action.MessageText), Participant.User, UtcDateTime.Now, evaluationCtx);
 }
Exemplo n.º 4
0
            protected override void OnAwaitingAction(IAction_ action, Application workflow, Opt <Result <ActionResponse> > response, Lead evaluationCtx)
            {
                var sendResult = _messageSvc.SendMessage(action.MessageText, workflow.MobileNo).Map(_ => action.MessageText);

                action.MarkAsActioned(sendResult, Participant.User, UtcDateTime.Now, evaluationCtx);
            }