Ejemplo n.º 1
0
        protected internal virtual void SendSignalToExecution(CommandContext commandContext, string signalName,
                                                              string executionId)
        {
            IExecutionManager executionManager = commandContext.ExecutionManager;
            ExecutionEntity   execution        = executionManager.FindExecutionById(executionId);

            EnsureUtil.EnsureNotNull("Cannot find execution with id '" + executionId + "'", "execution", execution);

            IEventSubscriptionManager       eventSubscriptionManager = commandContext.EventSubscriptionManager;
            IList <EventSubscriptionEntity> signalEvents             =
                eventSubscriptionManager.FindSignalEventSubscriptionsByNameAndExecution(signalName, executionId);

            EnsureUtil.EnsureNotEmpty("Execution '" + executionId + "' has not subscribed to a signal event with name '" + signalName + "'.", ListExt.ConvertToIlist(signalEvents));

            CheckAuthorizationOfCatchSignals(commandContext, signalEvents);
            NotifyExecutions(signalEvents);
        }