![]() |
VOOZH | about |
dotnet add package OpenHumanTask.Sdk --version 0.1.7
NuGet\Install-Package OpenHumanTask.Sdk -Version 0.1.7
<PackageReference Include="OpenHumanTask.Sdk" Version="0.1.7" />
<PackageVersion Include="OpenHumanTask.Sdk" Version="0.1.7" />Directory.Packages.props
<PackageReference Include="OpenHumanTask.Sdk" />Project file
paket add OpenHumanTask.Sdk --version 0.1.7
#r "nuget: OpenHumanTask.Sdk, 0.1.7"
#:package OpenHumanTask.Sdk@0.1.7
#addin nuget:?package=OpenHumanTask.Sdk&version=0.1.7Install as a Cake Addin
#tool nuget:?package=OpenHumanTask.Sdk&version=0.1.7Install as a Cake Tool
👁 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:
| Latest Releases | Conformance to spec version |
|---|---|
| 0.1.x | v0.1 |
dotnet nuget add package OpenHumanTask.Sdk
services.AddOpenHumanTask();
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
...
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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.