Example #1
0
        /// <summary>
        /// Process an <seealso cref="HistoryEvent"/> and handle them directly after creation.
        /// The <seealso cref="HistoryEvent"/> is created with the help of the given
        /// <seealso cref="HistoryEventCreator"/> implementation.
        /// </summary>
        /// <param name="creator"> the creator is used to create the <seealso cref="HistoryEvent"/> which should be thrown </param>
        public static void processHistoryEvents(HistoryEventCreator creator)
        {
            HistoryEventProducer historyEventProducer = Context.ProcessEngineConfiguration.HistoryEventProducer;
            HistoryEventHandler  historyEventHandler  = Context.ProcessEngineConfiguration.HistoryEventHandler;

            HistoryEvent singleEvent = creator.createHistoryEvent(historyEventProducer);

            if (singleEvent != null)
            {
                historyEventHandler.handleEvent(singleEvent);
            }

            IList <HistoryEvent> eventList = creator.createHistoryEvents(historyEventProducer);

            historyEventHandler.handleEvents(eventList);
        }
Example #2
0
        /// <summary>
        ///     Process an <seealso cref="HistoryEvent" /> and handle them directly after creation.
        ///     The <seealso cref="HistoryEvent" /> is created with the help of the given
        ///     <seealso cref="HistoryEventCreator" /> implementation.
        /// </summary>
        /// <param name="creator"> the creator is used to create the <seealso cref="HistoryEvent" /> which should be thrown </param>
        public static void ProcessHistoryEvents(HistoryEventCreator creator)
        {
            var historyEventProducer = Context.ProcessEngineConfiguration.HistoryEventProducer;
            var historyEventHandler  = Context.ProcessEngineConfiguration.HistoryEventHandler;

            IList <HistoryEvent> eventList = new List <HistoryEvent>();

            if (historyEventProducer != null)
            {
                var singleEvent = creator.CreateHistoryEvent(historyEventProducer);
                if (singleEvent != null)
                {
                    historyEventHandler.HandleEvent(singleEvent);
                }

                eventList = creator.CreateHistoryEvents(historyEventProducer);
            }

            historyEventHandler.HandleEvents(eventList);
        }