Add extensions to get and set CanStartWorkflow to API client

This commit is contained in:
Sipke Schoorstra 2023-07-01 11:39:40 +02:00
parent 5ccd2e5529
commit fe5cfc220d

View file

@ -86,4 +86,23 @@ public static class ActivityExtensions
metadata["showDescription"] = value;
activity.Metadata = metadata;
}
/// <summary>
/// Gets a value indicating whether the specified activity can trigger the workflow.
/// </summary>
public static bool? GetCanStartWorkflow(this Activity activity)
{
var properties = activity.CustomProperties;
return properties.TryGetValue<bool>("canStartWorkflow");
}
/// <summary>
/// Sets a value indicating whether the specified activity can trigger the workflow.
/// </summary>
public static void SetCanStartWorkflow(this Activity activity, bool value)
{
var properties = activity.CustomProperties;
properties["canStartWorkflow"] = value;
activity.CustomProperties = properties;
}
}