コード例 #1
0
        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);
コード例 #2
0
 public static async Task DispatchEntityChangedWorkflowsAsync(
     this IWorkflowLaunchpad workflowLaunchpad,
     string entityId,
     string entityName,
     EntityChangedAction changedAction,
     string?correlationId = default,
     string?contextId     = default,
     CancellationToken cancellationToken = default)
 {
     var input = new EntityChangedContext(entityId, entityName, changedAction);
     var query = QueryEntityChangedWorkflowsAsync(entityName, changedAction, correlationId, contextId);
     await workflowLaunchpad.CollectAndExecuteWorkflowsAsync(query, new WorkflowInput(input), cancellationToken);
 }
コード例 #3
0
        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));
        }
コード例 #4
0
 public static ISetupActivity <EntityChanged> WithAction(this ISetupActivity <EntityChanged> activity, EntityChangedAction action) => activity.Set(x => x.Action, action);
コード例 #5
0
ファイル: EntityChangedToken.cs プロジェクト: PiSim/LDb2
 public EntityChangedToken(object entity,
                           EntityChangedAction action)
 {
     Entity = entity;
     Action = action;
 }
コード例 #6
0
 public static IActivityBuilder EntityChanged <TEntity>(this IBuilder builder, EntityChangedAction action, [CallerLineNumber] int lineNumber = default, [CallerFilePath] string?sourceFile = default) =>
 builder.EntityChanged(setup => setup.WithEntity(typeof(TEntity)).WithAction(action), lineNumber, sourceFile);
コード例 #7
0
 public EntityChangedContext(string entityId, string entityName, EntityChangedAction action)
 {
     EntityId   = entityId;
     EntityName = entityName;
     Action     = action;
 }