jadex.gpmn.GpmnModelLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-kernel-gpmn Show documentation
Show all versions of jadex-kernel-gpmn Show documentation
The Jadex GPMN (goal oriented process modeling
notation) kernel provides a goal-oriented workflow
kernel. The idea is that a workflow is specified as
declarative goal hierarchy, which describes what has
to be achieved to fulfill the workflow. At runtime
goals are pursued by executing plans represented by
standard BPMN workflows. The execution of goal-based
workflows is achieved by conversion to BDI agents.
The newest version!
package jadex.gpmn;
import jadex.bridge.IResourceIdentifier;
import jadex.bridge.modelinfo.IModelInfo;
import jadex.commons.AbstractModelLoader;
import jadex.commons.ICacheableModel;
import jadex.commons.ResourceInfo;
import jadex.gpmn.model.MGpmnModel;
/**
* Loader for eclipse STP GPMN models (.gpmn files).
*/
public class GpmnModelLoader extends AbstractModelLoader
{
//-------- constants --------
/** The GPMN file extension. */
public static final String FILE_EXTENSION_GPMN = ".gpmn";
//-------- constructors --------
/**
* Create a new GPMN model loader.
*/
public GpmnModelLoader()
{
super(new String[]{FILE_EXTENSION_GPMN});
}
//-------- methods --------
/**
* Load a GPMN model.
* @param name The filename or logical name (resolved via imports and extensions).
* @param imports The imports, if any.
*/
public IModelInfo loadGpmnModel(String name, String[] imports, ClassLoader classloader, Object context) throws Exception
{
return ((MGpmnModel)loadModel(name, FILE_EXTENSION_GPMN, imports, classloader, context)).getModelInfo();
}
//-------- AbstractModelLoader methods --------
/**
* Load a model.
* @param name The original name (i.e. not filename).
* @param info The resource info.
*/
protected ICacheableModel doLoadModel(String name, String[] imports, ResourceInfo info,
ClassLoader classloader, Object context) throws Exception
{
return (ICacheableModel)GpmnXMLReader.read(info, classloader, (IResourceIdentifier)context);
}
}