VOOZH about

URL: https://www.nuget.org/packages/OpenHumanTask.Sdk/

⇱ NuGet Gallery | OpenHumanTask.Sdk 0.1.7




👁 Image
OpenHumanTask.Sdk 0.1.7

dotnet add package OpenHumanTask.Sdk --version 0.1.7
 
 
NuGet\Install-Package OpenHumanTask.Sdk -Version 0.1.7
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenHumanTask.Sdk" Version="0.1.7" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenHumanTask.Sdk" Version="0.1.7" />
 
Directory.Packages.props
<PackageReference Include="OpenHumanTask.Sdk" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenHumanTask.Sdk --version 0.1.7
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OpenHumanTask.Sdk, 0.1.7"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenHumanTask.Sdk@0.1.7
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenHumanTask.Sdk&version=0.1.7
 
Install as a Cake Addin
#tool nuget:?package=OpenHumanTask.Sdk&version=0.1.7
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Open Human Task Specification<br>NET Software Development Kit

👁 contributions welcome
👁 License
<img src="http://img.shields.io/badge/slack-@openhumantask-red?style=social&logo=slack">

Provides .NET API/SPI and Model Validation for the Open Human Task Specification.

With this SDK, you can:

  • Read and write human task JSON and YAML definitions
  • Programmatically build human task definitions
  • Validate human task definitions (both schema and DSL integrity validation)

Status

Latest Releases Conformance to spec version
0.1.x v0.1

Getting Started

dotnet nuget add package OpenHumanTask.Sdk
services.AddOpenHumanTask();

How to use

Building human task definitions programatically

You can build human task definitions programatically using the SDK's fluent builder API exposed by the HumanTaskDefinitionBuilder.

 var definition = new HumanTaskDefinitionBuilder()
 .WithName("fake-task")
 .WithNamespace("oht.sdk.unit-tests")
 .WithVersion("1.0.0-unitTest")
 .UseSpecVersion("0.1.0")
 .UseExpressionLanguage("jq")
 .UseAutomaticCompletionBehavior("reviewed", complete =>
 complete
 .When("${ $CONTEXT.form.data }")
 .SetOutput(new { fakeProperty = "fake-data" }))
 .Assign(assign => 
 assign
 .ToPotentialOwners(all => 
 all
 .Users()
 .WithClaim("role", "clerk"))
 .ToBusinessAdministrators(single =>
 single.User("fake-user@email.com"))
 .ToGroup("fake-group", all =>
 all
 .Users()
 .InRole(GenericHumanRole.PotentialOwner))
 .ToNotificationRecipients(all =>
 all
 .Users()
 .InGroup("fake-group")))
 .AddOutcome("fake-outcome", outcome =>
 outcome
 .When("${ $CONTEXT.form.data.reviewed }")
 .Outputs("en", "fake-en-value")
 .Outputs("fr", "fake-fr-value"))
 .UseForm(form => 
 form
 .WithData("${ $CONTEXT.inputData }")
 .DisplayUsing(view => 
 view
 .OfType("jsonform")
 .WithTemplate("fake-jsonform-template")))
 .UseStartDeadline(deadline =>
 deadline
 .ElapsesAfter(TimeSpan.FromMinutes(30))
 .Escalates(then =>
 then.Reassign()))
 .UseCompletionDeadline(deadline =>
 deadline
 .ElapsesAt(new(2023, 4, 4, 12, 30, 00, TimeSpan.Zero))
 .Escalates(then =>
 then.StartSubtask("fake-subtask-1", subtask =>
 subtask
 .WithDefinition("fake-namespace.fake-other-task:1.0.0-unitTest")
 .WithInput("${ $CONTEXT.form.inputData }"))))
 .AddSubtask("fake-subtask-2", subtask =>
 subtask.WithDefinition("fake-namespace.fake-other-task:1.5.1-unitTest"))
 .AnnotateWith("fake-annotation-key", "fake-annotation-value")
 .Build();

YAML output:

id: oht.sdk.unit-tests.fake-task:1.0.0-unitTest
name: fake-task
namespace: oht.sdk.unit-tests
version: 1.0.0-unitTest
specVersion: 0.1.0
routingMode: none
expressionLanguage: jq
peopleAssignments:
 potentialOwners:
 - users:
 withClaims:
 - type: role
 value: clerk
 businessAdministrators:
 - user: fake-user@email.com
 notificationRecipients:
 - users:
 inGroup: fake-group
 groups:
 - name: fake-group
 members:
 - users:
 inGenericRole: potentialOwner
form:
 data:
 state: ${ $CONTEXT.inputData }
subtasks:
- name: fake-subtask-2
 task:
 name: fake-other-task:1
 namespace: fake-namespace
subtaskExecutionMode: sequential
deadlines:
- type: start
 elapsesAfter: PT30M
 escalations:
 - action:
 reassignment: {}
- type: completion
 elapsesAt: 2023-04-04T12:30:00.0000000+00:00
 escalations:
 - action:
 subtask:
 name: fake-subtask-1
 task:
 name: fake-other-task:1
 namespace: fake-namespace
 input: ${ $CONTEXT.form.inputData }
completionBehaviors:
- name: reviewed
 type: automatic
 condition: ${ $CONTEXT.form.data }
outcomes:
- name: fake-outcome
 condition: ${ $CONTEXT.form.data.reviewed }
 value:
 fr: fake-fr-value
annotations:
 fake-annotation-key: fake-annotation-value
Reading human task definitions
...
var reader = HumanTaskDefinitionReader.Create();
using(Stream stream = File.OpenRead("human-task.json"))
{
 var definition = reader.Read(stream);
}
...
Product Versions Compatible and additional computed target framework versions.
.NET net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.7 656 10/12/2022
0.1.6 571 10/12/2022
0.1.5 584 10/12/2022
0.1.4 614 10/11/2022
0.1.3 571 10/9/2022
0.1.2 573 10/8/2022
0.1.1 583 10/8/2022
0.1.0 579 10/7/2022