protected override void ConfigureDefinition(FlowDefinition <ActivityStaticValueBindingsFlowRequest, ActivityStaticValueBindingsFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("BindFlowValues", new FlowActivityDefinition <StaticBindFlowValuesActivityRequest, StaticBindFlowValuesActivityResponse>()
         .BindInput(rq => rq.ActivityInputValue, nameof(ActivityStaticValueBindingsFlowRequest.FlowInput))
         .BindOutput(rs => rs.ActivityOutputValue, nameof(ActivityStaticValueBindingsFlowResponse.FlowOutput)));
 }
Beispiel #2
0
        protected override void ConfigureDefinition(FlowDefinition <TextTestFlowRequest, TextTestFlowResponse> flowDefinition)
        {
            flowDefinition

            .Do("Activity_1",
                new FlowOverrideKey("Activity_1-OverrideKey", "Activity_1 override description"),
                new FlowActivityDefinition <BasicActivityRequest, BasicActivityResponse>())
            .Do("Activity_2",
                new FlowActivityDefinition <TextTestActivityRequest, TextTestActivityResponse>()
                .SetValue(r => r.SetValue, "SetValue"))
            .Do("Activity_3", "Custom text",
                new FlowActivityDefinition <TextTestActivityRequest, TextTestActivityResponse>()
                .SetValue(r => r.SetValue, "SetValue"))

            .Check("Decision_1",
                   new FlowOverrideKey("Decision_1-OverrideKey", "Decision_1 override description"),
                   new FlowDecisionDefinition <BasicDecisionRequest, string>())
            .Else().Continue()

            .Check("Decision_2",
                   new FlowDecisionDefinition <TextTestDecisionRequest, string>()
                   .SetValue(r => r.SetValue, "SetValue"))
            .Else().Continue()

            .Check("Decision_3", "Custom text",
                   new FlowDecisionDefinition <TextTestDecisionRequest, string>()
                   .SetValue(r => r.SetValue, "SetValue"))
            .Else().Continue()

            .Label("Label_1")
            .Label("Label_2", "Custom text")
            ;
        }
Beispiel #3
0
        protected override void ConfigureDefinition(FlowDefinition <DecisionWithEndFlowRequest, DecisionWithEndFlowResponse> flowDefinition)
        {
            var switchValueDecision = FlowValueDecision <string> .NewDefinition()
                                      .BindInput(rq => rq.SwitchValue, nameof(DecisionWithEndFlowRequest.StringValue));

            var setOutputToX = new FlowActivityDefinition <SetStringFlowValueRequest, SetStringFlowValueResponse>()
                               .SetValue(rq => rq.OutputValue, "X")
                               .BindOutput(rs => rs.Output, nameof(DecisionWithEndFlowResponse.BranchValue));

            var setOutputToY = new FlowActivityDefinition <SetStringFlowValueRequest, SetStringFlowValueResponse>()
                               .SetValue(rq => rq.OutputValue, "Y")
                               .BindOutput(rs => rs.Output, nameof(DecisionWithEndFlowResponse.BranchValue));

            var setOutputToZ = new FlowActivityDefinition <SetStringFlowValueRequest, SetStringFlowValueResponse>()
                               .SetValue(rq => rq.OutputValue, "Z")
                               .BindOutput(rs => rs.Output, nameof(DecisionWithEndFlowResponse.BranchValue));

            flowDefinition
            .Do("Set_output_to_X", setOutputToX)

            .Check("Switch_value_1", switchValueDecision)
            .When("A").End()
            .When("B").Goto("Set_output_to_Y")
            .Else().Continue()

            .Do("Set_output_to_Y", setOutputToY)

            .Check("Switch_value_2", switchValueDecision)
            .When("C").Goto("Set_output_to_Z")
            .Else().End()

            .Do("Set_output_to_Z", setOutputToZ)
            ;
        }
 protected override void ConfigureDefinition(FlowDefinition <TestDictionaryListBindingsRequest, TestDictionaryListBindingsResponse> flowDefinition)
 {
     flowDefinition
     .Do("MapValues",
         new FlowActivityDefinition <DictionaryInputToOutputMapRequest, DictionaryInputToOutputMapResponse>()
         .BindInputs(rq => rq.FlowInputs, "FlowInput1", "FlowInput2")
         .BindOutputs(rs => rs.FlowOutputs, "FlowOutput1"));
 }
 protected override void ConfigureDefinition(FlowDefinition <TestDictionaryRegexBindingsRequest, TestDictionaryRegexBindingsResponse> flowDefinition)
 {
     flowDefinition
     .Do("MapValues",
         new FlowActivityDefinition <DictionaryInputToOutputMapRequest, DictionaryInputToOutputMapResponse>()
         .BindInputs(rq => rq.FlowInputs, new FlowValueRegexSelector("^FlowInput.*"))
         .BindOutputs(rs => rs.FlowOutputs, new FlowValueRegexSelector("^FlowOutput.*")));
 }
Beispiel #6
0
 protected override void ConfigureDefinition(FlowDefinition <OverriddenFlowRequest, OverriddenFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("Activity",
         new FlowActivityDefinition <SetStringFlowValueRequest, SetStringFlowValueResponse>()
         .SetValue(rq => rq.OutputValue, OverriddenFlowRequest.BaseValue)
         .BindOutput(rq => rq.Output, nameof(OverriddenFlowResponse.OutputValue)));
 }
 protected override void ConfigureDefinition(FlowDefinition <OverriddenActivityFlowRequest, OverriddenActivityFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("Activity", new FlowOverrideKey(OverriddenActivityFlowRequest.ActivityOverrideKey),
         new FlowActivityDefinition <OverridableActivityRequest, OverridableActivityResponse>()
         .SetValue(rq => rq.OverridableInputValue, OverriddenActivityFlowRequest.BaseValue)
         .SetValue(rq => rq.NonOverridableInputValue, OverriddenActivityFlowRequest.BaseValue));
 }
 protected override void ConfigureDefinition(FlowDefinition <ActivityOverriddenSettersFlowRequest, ActivityOverriddenSettersFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("SetOutputValues", new FlowActivityDefinition <OverriddenSettersActivityRequest, OverriddenSettersActivityResponse>()
         .BindInput(rq => rq.NonExistentSetterValue, "NonExistentValue")
         .BindInput(rq => rq.BoundValueWithDefault, nameof(ActivityOverriddenSettersFlowRequest.FlowNullValue))
         .BindInput(rq => rq.InputValue, nameof(ActivityOverriddenSettersFlowRequest.FlowInputValue)));
 }
        protected override void ConfigureDefinition(FlowDefinition <EnableableStepsFlowRequest, EnableableStepsFlowResponse> flowDefinition)
        {
            flowDefinition

            .Do("Activity_Default",
                new FlowActivityDefinition <EnableableActivityRequest, EnableableActivityResponse>())
            .Do("Activity_Enabled",
                new FlowActivityDefinition <EnableableActivityRequest, EnableableActivityResponse>()
                .SetValue(rq => rq.IsEnabled, true));
        }
 protected override void ConfigureDefinition(FlowDefinition <TestDictionarySubPropertyBindingsRequest, TestDictionarySubPropertyBindingsResponse> flowDefinition)
 {
     flowDefinition
     .Do("MapValues",
         new FlowActivityDefinition <DictionarySubPropertyBindingsMappingRequest, DictionarySubPropertyBindingsMappingResponse>()
         .BindInputs(rq => rq.NamedFlowInputs, new FlowValueListSelector("NamedInput1", "NamedInput2"), (int v) => v + 1)
         .BindOutputs(rs => rs.NamedFlowOutputs, new FlowValueListSelector("NamedOutput1", "NamedOutput2"), v => v + 1)
         .BindInputs(rq => rq.RegexFlowInputs, new FlowValueRegexSelector("^RegexInput.*"), (int v) => v + 2)
         .BindOutputs(rs => rs.RegexFlowOutputs, new FlowValueRegexSelector("^RegexOutput.*"), v => v + 2)
         );
 }
Beispiel #11
0
        protected override void ConfigureDefinition(FlowDefinition <ActivityBindingAttributesFlowRequest, ActivityBindingAttributesFlowResponse> flowDefinition)
        {
            flowDefinition
            .Do("Bind_inputs_and_outputs", new FlowActivityDefinition <BindingAttributesActivityRequest, BindingAttributesActivityResponse>()

                .SetValue(r => r.ActivityInput1Name, nameof(ActivityBindingAttributesFlowRequest.FlowInput1))
                .SetValue(r => r.NamedActivityInputName, nameof(ActivityBindingAttributesFlowRequest.FlowInput2))

                .SetValue(r => r.ActivityOutput1Name, nameof(ActivityBindingAttributesFlowResponse.FlowOutput1))
                .SetValue(r => r.NamedActivityOutputName, nameof(ActivityBindingAttributesFlowResponse.FlowOutput2))
                );
        }
Beispiel #12
0
 protected override void ConfigureDefinition(FlowDefinition <TestDictionaryListMapBindingsRequest, TestDictionaryListMapBindingsResponse> flowDefinition)
 {
     flowDefinition
     .Do("MapValues",
         new FlowActivityDefinition <DictionaryInputToOutputMapRequest, DictionaryInputToOutputMapResponse>()
         .BindInputs(rq => rq.FlowInputs, new Dictionary <string, string>
     {
         { "RequestValue1", "DictionaryValue1" },
         { "RequestValue2", "DictionaryValue2" },
     })
         .BindOutputs(rs => rs.FlowOutputs, new Dictionary <string, string>
     {
         { "DictionaryValue1", "ResponseValue1" },
     })
         );
 }
Beispiel #13
0
        protected override void ConfigureDefinition(FlowDefinition <ConfiguredFlowRequest, ConfiguredFlowResponse> flowDefinition)
        {
            flowDefinition
            .Do("Activity_1",
                new FlowActivityDefinition <ConfigurableActivityRequest, ConfigurableActivityResponse>()
                .SetValue(r => r.SetValue, "SetValue")
                .BindInput(r => r.BoundValue, "FlowValue")
                .BindOutput(r => r.OutputValue, "FlowValue"))

            .Check("Decision_1",
                   new FlowDecisionDefinition <ConfigurableDecisionRequest, string>()
                   .SetValue(r => r.SetValue, "SetValue")
                   .BindInput(r => r.BoundValue, "FlowValue"))
            .When("X").End()
            .Else().Continue();
        }
Beispiel #14
0
        protected override void ConfigureDefinition(FlowDefinition <MockActivityViaFlowRFlowRequest, MockActivityViaFlowRFlowResponse> flowDefinition)
        {
            flowDefinition
            .Do("Set_value_1_to_A",
                new FlowActivityDefinition <SetStringFlowValueRequest, SetStringFlowValueResponse>()
                .SetValue(r => r.OutputValue, "A")
                .BindOutput(r => r.Output, "Value1"))

            .Do("Set_value_2_to_B",
                new FlowActivityDefinition <SetStringFlowValueRequest, SetStringFlowValueResponse>()
                .SetValue(r => r.OutputValue, "B")
                .BindOutput(r => r.Output, "Value2"))

            .Do("Set_value_3_to_C",
                new FlowActivityDefinition <SetStringFlowValueRequest, SetStringFlowValueResponse>()
                .SetValue(r => r.OutputValue, "C")
                .BindOutput(r => r.Output, "Value3"));
        }
Beispiel #15
0
        protected override void ConfigureDefinition(FlowDefinition <MyFlowRequest, MyFlowResponse> flowDefinition)
        {
            flowDefinition

            .Do("Activity1",
                new FlowActivityDefinition <Activity1Request, Activity1Response>())

            .Check("FlowValue",
                   new FlowDecisionDefinition <FlowValueDecision <string>, string>()
                   .BindInput(req => req.SwitchValue, "FlowValue"))
            .When("2").Goto("Activity2")
            .Else().Goto("Activity3")

            .Do("Activity2",
                new FlowActivityDefinition <Activity2Request, Activity2Response>())
            .End()

            .Do("Activity3",
                new FlowActivityDefinition <Activity3Request, Activity3Response>());
        }
        protected override void ConfigureDefinition(FlowDefinition <TwentyQuestionsRequest, TwentyQuestionsResponse> flowDefinition)
        {
            flowDefinition

            .Do("AskHasLegs", QuestionRequest.NewDefinition()
                .SetValue(req => req.Question, "Does it have legs")
                .SetValue(req => req.Answers, new[] { "[Y]es", "[N]o" })
                .BindOutput(res => res.Answer, "HasLegs"))

            .Check("HasLegs", "Has legs?", FlowValueDecision <string> .NewDefinition()
                   .BindInput(req => req.SwitchValue, "HasLegs"))
            .When("Y").Goto("AskLegCount")
            .When("N").Goto("AskHasScales")
            .Else().Unhandled()

            .Do("AskLegCount", QuestionRequest.NewDefinition()
                .SetValue(req => req.Question, "How many legs does it have")
                .SetValue(req => req.Answers, new[] { "[2]", "[4]" })
                .BindOutput(res => res.Answer, "LegCount"))

            .Check("LegCount", "Leg count?", FlowValueDecision <string> .NewDefinition()
                   .BindInput(req => req.SwitchValue, "LegCount"))
            .When("2").Goto("AskCanFly")
            .When("4").Goto("AskEatsHay")
            .Else().Unhandled()

            .Do("AskCanFly", QuestionRequest.NewDefinition()
                .SetValue(req => req.Question, "Can it fly")
                .SetValue(req => req.Answers, new[] { "[Y]es", "[N]o" })
                .BindOutput(res => res.Answer, "CanFly"))

            .Check("CanFly", "Can fly?", FlowValueDecision <string> .NewDefinition()
                   .BindInput(req => req.SwitchValue, "CanFly"))
            .When("Y").Goto("GuessDuck")
            .When("N").Goto("GuessFarmer")
            .Else().Unhandled()

            .Do("AskEatsHay", QuestionRequest.NewDefinition()
                .SetValue(req => req.Question, "Does it eat hay")
                .SetValue(req => req.Answers, new[] { "[Y]es", "[N]o" })
                .BindOutput(res => res.Answer, "EatsHay"))

            .Check("EatsHay", "Eats hay?", FlowValueDecision <string> .NewDefinition()
                   .BindInput(req => req.SwitchValue, "EatsHay"))
            .When("Y").Goto("GuessHorse")
            .When("N").Goto("GuessCat")
            .Else().Unhandled()

            .Do("AskHasScales", QuestionRequest.NewDefinition()
                .SetValue(req => req.Question, "Does it have scales")
                .SetValue(req => req.Answers, new[] { "[Y]es", "[N]o" })
                .BindOutput(res => res.Answer, "HasScales"))

            .Check("HasScales", "Has scales?", FlowValueDecision <string> .NewDefinition()
                   .BindInput(req => req.SwitchValue, "HasScales"))
            .When("Y").Goto("GuessSnake")
            .When("N").Goto("GuessWorm")
            .Else().Unhandled()

            .Do("GuessDuck", GuessRequest.NewDefinition()
                .SetValue(req => req.Guess, "Duck"))
            .End()

            .Do("GuessFarmer", GuessRequest.NewDefinition()
                .SetValue(req => req.Guess, "Farmer"))
            .End()

            .Do("GuessHorse", GuessRequest.NewDefinition()
                .SetValue(req => req.Guess, "Horse"))
            .End()

            .Do("GuessCat", GuessRequest.NewDefinition()
                .SetValue(req => req.Guess, "Cat"))
            .End()

            .Do("GuessSnake", GuessRequest.NewDefinition()
                .SetValue(req => req.Guess, "Snake"))
            .End()

            .Do("GuessWorm", GuessRequest.NewDefinition()
                .SetValue(req => req.Guess, "Worm"))
            .End();
        }
 protected override void ConfigureDefinition(FlowDefinition <ActivityDesignTimeFlowRequest, ActivityDesignTimeFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("Set_output_from_design_time", new FlowActivityDefinition <DesignTimeActivityRequest, DesignTimeActivityResponse>()
         .SetValue(rq => rq.DesignTimeValue, DesignTimeValue));
 }
Beispiel #18
0
 protected override void ConfigureDefinition(FlowDefinition <MissingMandatoryActivityInputRequest, MissingMandatoryActivityInputResponse> flowDefinition)
 {
     flowDefinition
     .Do("MandatoryInputActivity",
         new FlowActivityDefinition <MandatoryInputActivityRequest, MandatoryInputActivityResponse>());
 }
Beispiel #19
0
 protected override void ConfigureDefinition(FlowDefinition <ActivityInputFlowRequest, ActivityInputFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("InputAndOutput", new FlowActivityDefinition <InputAndOutputActivityRequest, InputAndOutputActivityResponse>());
 }
 protected override void ConfigureDefinition(FlowDefinition <CanMockOnlyRootSubFlowRequest, CanMockOnlyRootSubFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("SetValue",
         new FlowActivityDefinition <CanMockOnlyRootSetValueRequest, CanMockOnlyRootSetValueResponse>());
 }
 protected override void ConfigureDefinition(FlowDefinition <FlowValueDictionaryDefaultRequest, FlowValueDictionaryDefaultResponse> flowDefinition)
 {
     flowDefinition
     .Do("MapValues",
         new FlowActivityDefinition <DictionaryInputToOutputMapRequest, DictionaryInputToOutputMapResponse>());
 }
Beispiel #22
0
 protected override void ConfigureDefinition(FlowDefinition <ActivityOutputFlowRequest, ActivityOutputFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("SingleOutput", new FlowActivityDefinition <SingleOutputActivityRequest, SingleOutputActivityResponse>());
 }
Beispiel #23
0
 protected override void ConfigureDefinition(FlowDefinition <SingleActivityFlowRequest, SingleActivityFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("DoNothing", new FlowActivityDefinition <DoNothingRequest, DoNothingResponse>());
 }
Beispiel #24
0
 protected override void ConfigureDefinition(FlowDefinition <SayHelloRequest, SayHelloResponse> flowDefinition)
 {
     flowDefinition
     .Do("SayHello", new FlowActivityDefinition <SayGreetingRequest, SayGreetingResponse>()
         .SetValue(req => req.Greeting, "Hello"));
 }
Beispiel #25
0
 protected override void ConfigureDefinition(FlowDefinition <ActivityLoggingFlowRequest, ActivityLoggingFlowResponse> flowDefinition)
 {
     flowDefinition
     .Do("LoggedActivity", new FlowActivityDefinition <LoggedActivityRequest, LoggedActivityResponse>());
 }
Beispiel #26
0
        protected override void ConfigureDefinition(FlowDefinition <MakeLoanApplicationDecision, MakeLoanApplicationDecision.Response> flowDefinition)
        {
            flowDefinition

            .Do("InitialiseNewDecision", InitialiseNewLoanDecision.NewDefinition())

            // ------------------------------------------------------------------------------------------------

            .Do("CheckEligibility", CheckEligibility.NewDefinition())
            .Check("IsEligible", FlowValueDecision <bool?> .NewDefinition()
                   .BindInput(rq => rq.SwitchValue, nameof(CheckEligibility.Response.IsEligible)))
            .When(false).Goto("SetResultToDecline")
            .When(true).Goto("CheckAffordability")
            .Else().Unhandled()

            // ------------------------------------------------------------------------------------------------

            .Do("CheckAffordability", CheckAffordability.NewDefinition())
            .Check("AffordabilityRating", FlowValueDecision <AffordabilityRating?> .NewDefinition()
                   .BindInput(rq => rq.SwitchValue, nameof(CheckAffordability.Response.AffordabilityRating)))
            .When(AffordabilityRating.Fair).Goto("SetResultToRefer")
            .When(AffordabilityRating.Poor).Goto("SetResultToDecline")
            .When(AffordabilityRating.Good).Goto("CheckIdentity")
            .Else().Unhandled()

            // ------------------------------------------------------------------------------------------------

            .Do("CheckIdentity", CheckIdentity.NewDefinition())
            .Check("IdentityCheckResult", FlowValueDecision <IdentityCheckResult?> .NewDefinition()
                   .BindInput(rq => rq.SwitchValue, nameof(CheckIdentity.Response.IdentityCheckResult)))
            .When(IdentityCheckResult.ServiceUnavailable).Goto("SetResultToRefer")
            .When(IdentityCheckResult.IdentityNotFound).Goto("SetResultToDecline")
            .When(IdentityCheckResult.IdentityFound).Goto("SetResultToAccept")
            .Else().Unhandled()

            // ------------------------------------------------------------------------------------------------

            .Do("SetResultToAccept", SetLoanDecisionResult.NewDefinition()
                .SetValue(rq => rq.Result, LoanDecisionResult.Accept))
            .Goto("SaveDecision")

            .Do("SetResultToRefer", SetLoanDecisionResult.NewDefinition()
                .SetValue(rq => rq.Result, LoanDecisionResult.Refer))
            .Goto("SaveDecision")

            .Do("SetResultToDecline", SetLoanDecisionResult.NewDefinition()
                .SetValue(rq => rq.Result, LoanDecisionResult.Decline))
            .Goto("SaveDecision")

            // ------------------------------------------------------------------------------------------------

            .Do("SaveDecision", CreateLoanDecision.NewDefinition())

            .Check("LoanDecisionResult", FlowValueDecision <LoanDecisionResult?> .NewDefinition()
                   .BindInput(rq => rq.SwitchValue, nameof(SetLoanDecisionResult.Response.Result)))
            .When(LoanDecisionResult.Decline).Goto("PostDeclineActions")
            .When(LoanDecisionResult.Refer).Goto("PostReferActions")
            .When(LoanDecisionResult.Accept).Goto("PostAcceptActions")
            .Else().Unhandled()

            // ------------------------------------------------------------------------------------------------

            .Label("PostAcceptActions")
            .Do("SendAcceptConfirmationEmail", SendEmail.NewDefinition()
                .SetValue(rq => rq.TemplateName, "AcceptConfirmation")
                .BindInput(rq => rq.EmailAddress,
                           nameof(MakeLoanApplicationDecision.LoanApplication), (LoanApplication la) => la.EmailAddress)
                .BindInputs(rq => rq.DataObjects,
                            nameof(MakeLoanApplicationDecision.LoanApplication),
                            nameof(InitialiseNewLoanDecision.Response.LoanDecision))
                .BindInput(rq => rq.ParentId,
                           nameof(InitialiseNewLoanDecision.Response.LoanDecision), (LoanDecision ld) => ld.Id))
            .End()

            // ------------------------------------------------------------------------------------------------

            .Label("PostReferActions")
            .Do("SendReferNotificationEmail", SendEmail.NewDefinition()
                .SetValue(rq => rq.TemplateName, "ReferNotification")
                .BindInput(rq => rq.EmailAddress,
                           nameof(MakeLoanApplicationDecision.LoanApplication), (LoanApplication la) => la.EmailAddress)
                .BindInputs(rq => rq.DataObjects,
                            nameof(MakeLoanApplicationDecision.LoanApplication),
                            nameof(InitialiseNewLoanDecision.Response.LoanDecision))
                .BindInput(rq => rq.ParentId,
                           nameof(InitialiseNewLoanDecision.Response.LoanDecision), (LoanDecision ld) => ld.Id))
            .Do("RaiseLoanReferredEvent", RaiseLoanDecisionReferredEvent.NewDefinition())
            .End()

            // ------------------------------------------------------------------------------------------------

            .Label("PostDeclineActions")
            .Do("SendDeclineConfirmationEmail", SendEmail.NewDefinition()
                .SetValue(rq => rq.TemplateName, "DeclineConfirmation")
                .BindInput(rq => rq.EmailAddress,
                           nameof(MakeLoanApplicationDecision.LoanApplication), (LoanApplication la) => la.EmailAddress)
                .BindInputs(rq => rq.DataObjects,
                            nameof(MakeLoanApplicationDecision.LoanApplication),
                            nameof(InitialiseNewLoanDecision.Response.LoanDecision))
                .BindInput(rq => rq.ParentId,
                           nameof(InitialiseNewLoanDecision.Response.LoanDecision), (LoanDecision ld) => ld.Id))
            .End();
        }