diff --git a/build.ps1 b/build.ps1 index 71dc996..04ffe76 100644 --- a/build.ps1 +++ b/build.ps1 @@ -12,6 +12,7 @@ $durableEnginePath = "$PSScriptRoot/src/DurableEngine" $durableAppPath = "$PSScriptRoot/test/E2E/durableApp/Modules/$packageName" $powerShellModulePath = "$PSScriptRoot/src/$packageName.psm1" $manifestPath = "$PSScriptRoot/src/$packageName.psd1" +$viewPath = "$PSScriptRoot/src/task.format.ps1xml" $outputPath = "$PSScriptRoot/src/out/" if ($Configuration -eq "Debug") @@ -99,8 +100,9 @@ Get-ChildItem -Path "$shimPath/$publishPathSuffix" | Where-Object { $_.Extension -in '.dll','.pdb' -and -not $commonFiles.Contains($_.Name) } | ForEach-Object { Copy-Item -LiteralPath $_.FullName -Destination $outputPath } -# Move Durable SDK manifest into the output directory -Write-Log "Copying PowerShell module and manifest from the Durable SDK source code into $outputPath" "Gray" +# Move Durable SDK manifest and ps1xml into the output directory +Write-Log "Copying PowerShell module, manifest, and ps1xml from the Durable SDK source code into $outputPath" "Gray" Copy-Item -Path $powerShellModulePath -Destination $outputPath Copy-Item -Path $manifestPath -Destination $outputPath +Copy-Item -Path $viewPath -Destination $outputPath Write-Log "Build succeeded!" \ No newline at end of file diff --git a/src/AzureFunctions.PowerShell.Durable.SDK.psd1 b/src/AzureFunctions.PowerShell.Durable.SDK.psd1 index abaf1c6..b7effaf 100644 --- a/src/AzureFunctions.PowerShell.Durable.SDK.psd1 +++ b/src/AzureFunctions.PowerShell.Durable.SDK.psd1 @@ -55,7 +55,7 @@ # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module - # FormatsToProcess = @() + FormatsToProcess = @(".\task.format.ps1xml") # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess NestedModules = @('.\AzureFunctions.PowerShell.Durable.SDK.dll', '.\AzureFunctions.PowerShell.Durable.SDK.psm1') diff --git a/src/DurableEngine/Tasks/ActivityInvocationTask.cs b/src/DurableEngine/Tasks/ActivityInvocationTask.cs index 8a3442a..cbe91ba 100644 --- a/src/DurableEngine/Tasks/ActivityInvocationTask.cs +++ b/src/DurableEngine/Tasks/ActivityInvocationTask.cs @@ -18,11 +18,11 @@ namespace DurableEngine.Tasks public class ActivityInvocationTask : DurableTask { - internal string FunctionName { get; } + public string FunctionName { get; internal set;} - internal object Input { get; } + public object Input { get; internal set; } - private RetryOptions RetryOptions { get; } + public RetryOptions RetryOptions { get; internal set;} public ActivityInvocationTask( string functionName, diff --git a/src/DurableEngine/Tasks/DurableTimerTask.cs b/src/DurableEngine/Tasks/DurableTimerTask.cs index 152ce4e..69d9b63 100644 --- a/src/DurableEngine/Tasks/DurableTimerTask.cs +++ b/src/DurableEngine/Tasks/DurableTimerTask.cs @@ -17,8 +17,8 @@ namespace DurableEngine.Tasks // All DurableTimerTasks must be complete or canceled for the orchestration to complete public class DurableTimerTask : DurableTask { - internal TimeSpan Duration { get; } - private DateTime FireAt { get; } + public TimeSpan Duration { get; internal set; } + public DateTime FireAt { get; private set; } private CreateDurableTimerAction Action { get; set; } private readonly CancellationTokenSource _cancelationTokenSource = new CancellationTokenSource(); diff --git a/src/DurableEngine/Tasks/ExternalEventTask.cs b/src/DurableEngine/Tasks/ExternalEventTask.cs index 062f2d5..9fb6c32 100644 --- a/src/DurableEngine/Tasks/ExternalEventTask.cs +++ b/src/DurableEngine/Tasks/ExternalEventTask.cs @@ -13,7 +13,7 @@ namespace DurableEngine.Tasks public class ExternalEventTask : DurableTask { - internal string ExternalEventName { get; } + public string ExternalEventName { get; internal set; } public ExternalEventTask( string externalEventName, diff --git a/src/DurableEngine/Tasks/SubOrchestratorTask.cs b/src/DurableEngine/Tasks/SubOrchestratorTask.cs index a7f1d17..23521b1 100644 --- a/src/DurableEngine/Tasks/SubOrchestratorTask.cs +++ b/src/DurableEngine/Tasks/SubOrchestratorTask.cs @@ -13,12 +13,12 @@ namespace DurableEngine.Tasks { public class SubOrchestratorTask : DurableTask { - internal string FunctionName { get; } - internal string InstanceId { get; } + public string FunctionName { get; internal set; } + public string InstanceId { get; internal set;} - internal object Input { get; } + public object Input { get; internal set; } - private RetryOptions RetryOptions { get; } + public RetryOptions RetryOptions { get; internal set; } public SubOrchestratorTask( string functionName, diff --git a/src/task.format.ps1xml b/src/task.format.ps1xml new file mode 100644 index 0000000..0e2354e --- /dev/null +++ b/src/task.format.ps1xml @@ -0,0 +1,159 @@ + + + + + ActivityTaskView + + DurableEngine.Tasks.ActivityInvocationTask + + + + + + + + + + + + + + + + + + + + + + + + "Activity" + + + FunctionName + + + Input + + + RetryOptions + + + NoWait + + + + + + + + DurableTimerTaskView + + DurableEngine.Tasks.DurableTimerTask + + + + + + + + + + + + + + + + + + "DurableTimer" + + + Duration + + + FireAt + + + + + + + + ExternalEventTaskView + + DurableEngine.Tasks.ExternalEventTask + + + + + + + + + + + + + + + "ExternalEvent" + + + ExternalEventName + + + + + + + + SubOrchestratorTask + + DurableEngine.Tasks.SubOrchestratorTask + + + + + + + + + + + + + + + + + + + + + + + + "SubOrchestrator" + + + FunctionName + + + InstanceId + + + Input + + + RetryOptions + + + + + + + + \ No newline at end of file diff --git a/test/E2E/durableApp/DurableClient/run.ps1 b/test/E2E/durableApp/DurableClient/run.ps1 index af8b2cc..ef16344 100644 --- a/test/E2E/durableApp/DurableClient/run.ps1 +++ b/test/E2E/durableApp/DurableClient/run.ps1 @@ -13,7 +13,7 @@ $Response = New-DurableOrchestrationCheckStatusResponse -Request $Request -Insta Push-OutputBinding -Name Response -Value $Response $Status = Get-DurableStatus -InstanceId $InstanceId -Write-Host "Orchestration $InstanceId status: $($Status | ConvertTo-Json)" +#Write-Host "Orchestration $InstanceId status: $($Status | ConvertTo-Json)" if ($Status.RuntimeStatus -notin 'Pending', 'Running', 'Failed', 'Completed') { throw "Unexpected orchestration $InstanceId runtime status: $($Status.RuntimeStatus)" } diff --git a/test/E2E/durableApp/SimpleOrchestrator/run.ps1 b/test/E2E/durableApp/SimpleOrchestrator/run.ps1 index dca78f0..58f16c6 100644 --- a/test/E2E/durableApp/SimpleOrchestrator/run.ps1 +++ b/test/E2E/durableApp/SimpleOrchestrator/run.ps1 @@ -4,6 +4,10 @@ param($Context) $ErrorActionPreference = 'Stop' -$output = Invoke-DurableActivity -FunctionName "Hello" -Input "Tokyo" +$output = Invoke-DurableActivity -FunctionName "Hello" -Input "Tokyo" -NoWait +$output = Start-DurableTimer -Duration (New-TimeSpan -Seconds 5) -NoWait +$output = Start-DurableExternalEventListener -EventName "TESTEVENTNAME" -NoWait +$output = Invoke-DurableSubOrchestrator -FunctionName "SimpleOrchestrator" -NoWait +Write-Output $output -return $output +#return "bye!"