Monitoring Process Execution

The Infinity Process Platform provides the Service Provider Interface IProcessExecutionMonitor to monitor process execution. Please refer to the according JavaDoc IProcessExecutionMonitor for detailed information on the interface.

package org.eclipse.stardust.engine.core.spi.monitoring;

import org.eclipse.stardust.common.annotations.SPI;

import org.eclipse.stardust.common.annotations.Status;
import org.eclipse.stardust.common.annotations.UseRestriction;
import org.eclipse.stardust.engine.core.runtime.beans.IProcessInstance;

@SPI(useRestriction = UseRestriction.Public, status = Status.Stable)
public interface IProcessExecutionMonitor
{
   void processStarted(IProcessInstance process);

   void processCompleted(IProcessInstance process);

   void processAborted(IProcessInstance process);

   void processInterrupted(IProcessInstance process);
}

The interface has several methods for propagating process execution states:

Creating a custom Implementation

To implement the IProcessExecutionMonitor interface and publish the implementation to the engine, a file named by the interface's factory has to be created in the /META-INF/services folder of the jar. Perform the following steps:

  1. Implement the interface as shown below
  2. Create a text file named org.eclipse.stardust.engine.core.spi.monitoring.IProcessExecutionMonitor. The file contents needs to be the fully qualified name of your implementation class, e.g. org.eclipse.stardust.example.ProcessExecutionMonitorImpl.
  3. Place the file into the META-INF/services folder of the jar that will contain your implementation class
package org.eclipse.stardust.example;

import org.eclipse.stardust.engine.core.runtime.beans.IProcessInstance;
import org.eclipse.stardust.engine.core.spi.monitoring.IProcessExecutionMonitor;

public class ProcessExecutionMonitorImpl implements IProcessExecutionMonitor {

   @Override
   public void processStarted(IProcessInstance process) {
   }

   @Override
   public void processCompleted(IProcessInstance process) {
   }

   @Override
   public void processAborted(IProcessInstance process) {
   }

   @Override
   public void processInterrupted(IProcessInstance process) {
   }

}