public virtual void Parse(EventReader reader, HistoryEventHandler handler)
 {
     lock (this)
     {
         int          eventCtr = 0;
         HistoryEvent @event;
         try
         {
             while ((@event = reader.GetNextEvent()) != null)
             {
                 handler.HandleEvent(@event);
                 ++eventCtr;
             }
         }
         catch (IOException ioe)
         {
             Log.Info("Caught exception parsing history file after " + eventCtr + " events", ioe
                      );
             parseException = ioe;
         }
         finally
         {
             @in.Close();
         }
     }
 }
 /// <exception cref="System.IO.IOException"/>
 public virtual void Parse(HistoryEventHandler handler)
 {
     lock (this)
     {
         Parse(new EventReader(@in), handler);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Perform common setup.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void setUp() throws Exception
        protected internal override void setUp()
        {
            base.setUp();
            // save current history event handler
            originalHistoryEventHandler = processEngineConfiguration.HistoryEventHandler;
            // clear the event counter
            countCustomHistoryEventHandler = 0;
        }
Beispiel #4
0
        public virtual void testCompositeDbHistoryEventHandlerArgumentConstructorWithNullVarargs()
        {
            HistoryEventHandler historyEventHandler = null;

            try
            {
                new CompositeDbHistoryEventHandler(historyEventHandler);
                fail("NullValueException expected");
            }
            catch (NullValueException e)
            {
                assertTextPresent("History event handler is null", e.Message);
            }
        }
Beispiel #5
0
        public virtual void fireHistoricCaseActivityInstanceUpdate()
        {
            ProcessEngineConfigurationImpl configuration = Context.ProcessEngineConfiguration;
            HistoryLevel historyLevel = configuration.HistoryLevel;

            if (historyLevel.isHistoryEventProduced(HistoryEventTypes.CASE_ACTIVITY_INSTANCE_UPDATE, this))
            {
                CmmnHistoryEventProducer eventProducer = configuration.CmmnHistoryEventProducer;
                HistoryEventHandler      eventHandler  = configuration.HistoryEventHandler;

                HistoryEvent @event = eventProducer.createCaseActivityInstanceUpdateEvt(this);
                eventHandler.handleEvent(@event);
            }
        }
Beispiel #6
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);
        }
Beispiel #7
0
        /// <summary>
        /// Adds the <seealso cref="HistoryEventHandler"/> to the list of
        /// <seealso cref="HistoryEventHandler"/> that consume the event.
        /// </summary>
        /// <param name="historyEventHandler">
        ///          the <seealso cref="HistoryEventHandler"/> that consume the event. </param>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public void add(final HistoryEventHandler historyEventHandler)
        public virtual void add(HistoryEventHandler historyEventHandler)
        {
            EnsureUtil.ensureNotNull("History event handler", historyEventHandler);
            historyEventHandlers.Add(historyEventHandler);
        }