All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bpmn.features.impl.BpmnMonitoringComponentFeature Maven / Gradle / Ivy

Go to download

The Jadex BPMN kernel provides a workflow kernel for the standardized business process modeling notation. The kernel relies on annotated BPMN diagrams, which include detailed execution information.

There is a newer version: 4.0.267
Show newest version
package jadex.bpmn.features.impl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import jadex.bpmn.features.IBpmnComponentFeature;
import jadex.bpmn.features.IInternalBpmnComponentFeature;
import jadex.bpmn.runtime.ProcessThread;
import jadex.bridge.IInternalAccess;
import jadex.bridge.component.ComponentCreationInfo;
import jadex.bridge.component.impl.MonitoringComponentFeature;
import jadex.bridge.service.types.monitoring.IMonitoringEvent;

/**
 *  Overrides the monitoring feature to add the logic for current state.
 */
public class BpmnMonitoringComponentFeature extends MonitoringComponentFeature
{
	/**
	 *  Create the feature.
	 */
	public BpmnMonitoringComponentFeature(IInternalAccess component, ComponentCreationInfo cinfo)
	{
		super(component, cinfo);
	}
	
	/**
	 *  Get the current state as monitoring events.
	 */
	public List getCurrentStateEvents()
	{
		List ret = super.getCurrentStateEvents();
		if(ret==null)
			ret = new ArrayList();
		
		IInternalBpmnComponentFeature bcf = (IInternalBpmnComponentFeature)getComponent().getComponentFeature(IBpmnComponentFeature.class);

		for(Iterator it= bcf.getTopLevelThread().getAllThreads().iterator(); it.hasNext(); )
		{
			ret.add(bcf.createThreadEvent(IMonitoringEvent.EVENT_TYPE_CREATION, it.next()));
		}
		return ret;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy