[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[bpmn2-modeler-dev] BPMN Extension - Error
|
Hi,
I am following the below link for the extension of BPMN 2.0 Eclipse plugin. It's a simple extension to add new property/ies for the task element.
I have Eclipse Luna (4.4.2) and BPMN Modeler (1.1.4) installed.
After following all those steps which have been mentioned in the link, I got an error at the end when I am trying to create a new BPMN 2.0 model file. (Please find attached files, screenshots of the steps and classes)
Any help in this regard will be highly appreciated. Looking forward to hear from you.
Regards, Abdul Wahab
|
Attachment:
P1.png
Description: PNG image
Attachment:
p2.png
Description: PNG image
Attachment:
p3.png
Description: PNG image
Attachment:
p4.png
Description: PNG image
Attachment:
p5.png
Description: PNG image
package emfextension;
import org.eclipse.bpmn2.modeler.core.IBpmn2RuntimeExtension;
import org.eclipse.bpmn2.modeler.core.LifecycleEvent;
import org.eclipse.bpmn2.modeler.core.utils.ModelUtil.Bpmn2DiagramType;
import org.eclipse.bpmn2.modeler.ui.DefaultBpmn2RuntimeExtension.RootElementParser;
import org.eclipse.bpmn2.modeler.ui.wizards.FileService;
import org.eclipse.ui.IEditorInput;
import org.xml.sax.InputSource;
public class ImixsRuntimeExtension implements IBpmn2RuntimeExtension {
@Override
public String getTargetNamespace(Bpmn2DiagramType arg0) {
return "http://www.imixs.org/bpmn2";
}
@Override
public boolean isContentForRuntime(IEditorInput input) {
InputSource source = new InputSource(FileService.getInputContents(input));
RootElementParser parser = new RootElementParser("http://www.imixs.org/bpmn2");
parser.parse(source);
return parser.getResult();
}
@Override
public void notify(LifecycleEvent arg0) {
// TODO Auto-generated method stub
}
}
package emfextension;
import org.eclipse.bpmn2.modeler.core.features.CustomShapeFeatureContainer;
import org.eclipse.emf.ecore.*;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.custom.ICustomFeature;
import org.eclipse.bpmn2.modeler.core.features.ShowPropertiesFeature;
import org.eclipse.bpmn2.modeler.core.model.ModelDecorator;
public class TestTaskElementFeatureContainer1 extends
CustomShapeFeatureContainer {
private final static String TYPE_VALUE = "TestTask";
private final static String CUSTOM_TASK_ID = "EmfExtension.customTask";
public TestTaskElementFeatureContainer1() {
// TODO Auto-generated constructor stub
}
@Override
public String getId(EObject object) {
// This is where we inspect the object to determine what its custom task ID should be.
// In this case, the "type" attribute will have a value of "MyTask".
// If found, return the CUSTOM_TASK_ID string.
//
// Note that the object inspection can be arbitrarily complex and may include several
// object features. This simple case just demonstrates what needs to happen here.
EStructuralFeature f = ModelDecorator.getAnyAttribute(object, "type");
if (f!=null) {
Object id = object.eGet(f);
if (TYPE_VALUE.equals(id))
return CUSTOM_TASK_ID;
}
return null;
}
@Override
public ICustomFeature[] getCustomFeatures(IFeatureProvider fp) {
return new ICustomFeature[] {new ShowPropertiesFeature(fp)};
}
}