Add IsWorkflowDefinitionActivity method to ActivityExtensions
A new method, GetIsWorkflowDefinitionActivity, has been added to the ActivityExtensions class. This method checks a given JsonObject representing an activity to determine if it's a workflow definition activity. It returns true if the activity indeed is; otherwise, it returns false.
This commit is contained in:
parent
49e96d53b3
commit
e9f1aade15
|
|
@ -150,4 +150,11 @@ public static class ActivityExtensions
|
|||
/// Gets the root activity in the specified activity.
|
||||
/// </summary>
|
||||
public static string? GetWorkflowDefinitionId(this JsonObject activity) => activity.GetProperty<string?>("workflowDefinitionId");
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the given activity is a workflow definition activity.
|
||||
/// </summary>
|
||||
/// <param name="activity">The JsonObject representing the activity.</param>
|
||||
/// <returns>Returns true if the activity is a workflow definition activity; otherwise, false.</returns>
|
||||
public static bool GetIsWorkflowDefinitionActivity(this JsonObject activity) => activity.ContainsKey("workflowDefinitionId") && activity.ContainsKey("workflowDefinitionVersionId");
|
||||
}
|
||||
Loading…
Reference in a new issue