Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: for the plan.

Jump to: navigation, search

Stardust/Knowledge Base/Java API/IPartitionMonitor Example

The IPartitionMonitor service provider interface can be used to execute custom code when

  • a process model is deployed or deleted
  • a user is created, disabled or enabled
  • a user realm is created or dropped

This SPI can for instance be used to implement

  • a push synchronization of process participants and entitlements in other systems when a process model is deployed.
  • a callback to external systems to keep the user information in sync or send notifications

(also see SynchronizationProvider interface which syncs users and entitlements on login of an individual user)


  1. Implement the IWorklistMonitor interface as shown below.
  2. Create a text file named org.eclipse.stardust.engine.core.spi.monitoring.IPartitionMonitor. The file contents needs to be the fully qualified name of your implementation class, e.g. org.eclipse.stardust.example.PartitionMonitorImpl.
  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 java.util.Iterator;
import org.eclipse.stardust.common.log.LogManager;
import org.eclipse.stardust.common.log.Logger;
import org.eclipse.stardust.engine.api.model.IModel;
import org.eclipse.stardust.engine.api.model.IProcessDefinition;
import org.eclipse.stardust.engine.api.model.IRole;
import org.eclipse.stardust.engine.api.runtime.DeploymentException;
import org.eclipse.stardust.engine.core.model.utils.ModelElementList;
import org.eclipse.stardust.engine.core.runtime.beans.IUser;
import org.eclipse.stardust.engine.core.runtime.beans.IUserRealm;
import org.eclipse.stardust.engine.core.spi.monitoring.IPartitionMonitor;
public class PartitionMonitorImpl implements IPartitionMonitor {
	final Logger log = LogManager.getLogger(PartitionMonitorImpl.class);
	public void modelDeleted(IModel arg0) throws DeploymentException {
	public void modelDeployed(IModel model, boolean arg1)
			throws DeploymentException {"In modelDeployed. ModelId:" + model.getId());
		ModelElementList<IProcessDefinition> pdList = model.getProcessDefinitions();
		for (IProcessDefinition pd : pdList) {"Found process definition: " + pd.getId());
		Iterator<IRole> ritr = model.getAllRoles();
		while (ritr.hasNext()) {
			IRole role =;;
	public void userCreated(IUser arg0) {
	public void userDisabled(IUser arg0) {
	public void userEnabled(IUser arg0) {
	public void userRealmCreated(IUserRealm arg0) {
	public void userRealmDropped(IUserRealm arg0) {

Back to the top