public static async Task TriggerEntityChangedWorkflowsAsync( this IWorkflowDispatcher workflowDispatcher, string entityId, string entityName, EntityChangedAction changedAction, string?correlationId = default, string?contextId = default, CancellationToken cancellationToken = default) { const string activityType = nameof(EntityChanged); var input = new EntityChangedContext(entityId, entityName, changedAction); var trigger = new EntityChangedBookmark( entityName, changedAction, contextId, null ); var bookmark = new EntityChangedBookmark( entityName, changedAction, contextId, correlationId ); await workflowDispatcher.DispatchAsync(new TriggerWorkflowsRequest(activityType, bookmark, trigger, input, correlationId, default, contextId, TenantId), cancellationToken);
private static WorkflowsQuery QueryEntityChangedWorkflowsAsync( string entityName, EntityChangedAction changedAction, string?correlationId = default, string?contextId = default) { const string activityType = nameof(EntityChanged); var bookmark = new EntityChangedBookmark( entityName, changedAction ); return(new WorkflowsQuery(activityType, bookmark, correlationId, ContextId: contextId)); }