-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
An orchestrator with an input parameter
- Loading branch information
Mikhail Shilkov
committed
Dec 6, 2018
1 parent
9f3f7f5
commit a19abeb
Showing
10 changed files
with
121 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace samples | ||
|
||
open Microsoft.Azure.WebJobs | ||
open DurableFunctions.FSharp | ||
|
||
open TypedSequence | ||
|
||
module InputParameter = | ||
|
||
let workflow input = orchestrator { | ||
let! hello1 = Activity.call sayHello (input + " Tokyo") | ||
let! hello2 = Activity.call sayHello (input + " Seattle") | ||
let! hello3 = Activity.call sayHello (input + " London") | ||
|
||
// given "Bla" returns ["Hello Bla Tokyo!", "Hello Bla Seattle!", "Hello Bla London!"] | ||
return [hello1; hello2; hello3] | ||
} | ||
|
||
[<FunctionName("WorkflowWithInputParameter")>] | ||
let Run ([<OrchestrationTrigger>] context: DurableOrchestrationContext) = | ||
Orchestrator.run (workflow, context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.106 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "samples", "samples.fsproj", "{4F0C07E8-110A-401C-9AA6-F5D93366110B}" | ||
EndProject | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "DurableFunctions.FSharp", "..\src\DurableFunctions.FSharp\DurableFunctions.FSharp.fsproj", "{B6FE2E57-18D5-4C14-8B17-2074E39428CA}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{4F0C07E8-110A-401C-9AA6-F5D93366110B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{4F0C07E8-110A-401C-9AA6-F5D93366110B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{4F0C07E8-110A-401C-9AA6-F5D93366110B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{4F0C07E8-110A-401C-9AA6-F5D93366110B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B6FE2E57-18D5-4C14-8B17-2074E39428CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B6FE2E57-18D5-4C14-8B17-2074E39428CA}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B6FE2E57-18D5-4C14-8B17-2074E39428CA}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B6FE2E57-18D5-4C14-8B17-2074E39428CA}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {C0A21BDC-E18B-479C-AAFF-C305569CCF13} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.106 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "DurableFunctions.FSharp", "DurableFunctions.FSharp\DurableFunctions.FSharp.fsproj", "{23142B6C-108F-4C1C-8A40-9BCE38D01890}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{23142B6C-108F-4C1C-8A40-9BCE38D01890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{23142B6C-108F-4C1C-8A40-9BCE38D01890}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{23142B6C-108F-4C1C-8A40-9BCE38D01890}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{23142B6C-108F-4C1C-8A40-9BCE38D01890}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {08BC5382-2949-432C-8F9C-C2BE31BA58AC} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace DurableFunctions.FSharp | ||
|
||
open System.Threading.Tasks | ||
open Microsoft.Azure.WebJobs | ||
open OrchestratorBuilder | ||
|
||
type Orchestrator = class | ||
|
||
/// Runs a workflow which expects an input parameter by reading this parameter from | ||
/// the orchestration context. | ||
static member run (workflow : ContextTask<'b>, context : DurableOrchestrationContext) : Task<'b> = | ||
workflow context | ||
|
||
/// Runs a workflow which expects an input parameter by reading this parameter from | ||
/// the orchestration context. | ||
static member run (workflow : 'a -> ContextTask<'b>, context : DurableOrchestrationContext) : Task<'b> = | ||
let input = context.GetInput<'a> () | ||
workflow input context | ||
end |