|
Re: A subtype of ScriptTask [message #1236580 is a reply to message #1236564] |
Mon, 27 January 2014 15:31 |
|
I believe everything you're trying to do is covered in the Custom Task example plug-in. To experiment with this plug-in, import the project from ~/examples/org.eclipse.bpmn2.modeler.examples.customtask into your development workbench. After launching a new eclipse workbench, create a new project and set its Target Runtime to "Custom Task Example Runtime Extension" from the project properties. Now when you create a new Process file in that project, it will use the Custom Task plug-in.
Follow the code that implements "My Task" in the "My Tools" category of the Tool Palette - this should get you started.
If you're still lost, please ask
Cheers,
Bob
|
|
|
|
|
|
|
Re: A subtype of ScriptTask [message #1236908 is a reply to message #1236746] |
Tue, 28 January 2014 11:09 |
Rui Domingues Messages: 194 Registered: October 2010 |
Senior Member |
|
|
Thanks.
The second problem occurs because in org.eclipse.bpmn2.modeler.ui.features.activity.task.CustomShapeFeatureContainer
the icon is added only if addFeatureDelegate hasn't added one yet.
@Override
public PictogramElement add(IAddContext context) {
PictogramElement pe = addFeatureDelegate.add(context);
// make sure everyone knows that this PE is a custom task
if (pe!=null)
Graphiti.getPeService().setPropertyValue(pe,CUSTOM_ELEMENT_ID,getId());
// add an icon to the top-left corner if applicable, and if the implementing
// addFeatureDelegate hasn't already done so.
String icon = customTaskDescriptor.getIcon();
if (icon!=null && pe instanceof ContainerShape) {
boolean addImage = true;
ContainerShape containerShape = (ContainerShape)pe;
GraphicsAlgorithm ga =
GraphicsAlgorithm)AbstractBpmn2AddFeature.getGraphicsAlgorithm(containerShape);
for (PictogramElement child : containerShape.getChildren()) {
if (child.getGraphicsAlgorithm() instanceof Image) {
addImage = false;
break;
}
}
if (ga!=null) {
for (GraphicsAlgorithm g : ga.getGraphicsAlgorithmChildren()) {
if (g instanceof Image) {
addImage = false;
break;
}
}
}
else
addImage = false;
if (addImage) {
Image img = CustomTaskImageProvider.createImage(customTaskDescriptor, ga, icon, 24, 24);
Graphiti.getGaService().setLocationAndSize(img, 2, 2, 24, 24);
}
}
return pe;
}
Thanks again
|
|
|
Re: A subtype of ScriptTask [message #1237093 is a reply to message #1236908] |
Tue, 28 January 2014 21:07 |
|
OK.
For the first issue you brought up (description in toolpalette) is a documentation problem: the "description" attribute in your plugin.xml is the text displayed in the "Description" tab for the Custom Task object, and not the tooltip text in for the toolpalette item. Unfortunately there is currently no way to change the toolpalette tooltip text, it will always be "Create <some object type>".
For the second issue: I'm assuming you can code your way around this?
|
|
|
|
Powered by
FUDForum. Page generated in 0.05350 seconds