cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti Designer Extension

gecos
Champ in-the-making
Champ in-the-making
I created an extension for the palette of the designer but when I activiti a new project and want to add a new diagram palette I get no objects and gives me the error I show below. I Take the instructions of the user guide in the chapter "Extending Designer activiti "

Thanks

Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".

java.lang.NullPointerException
   at org.eclipse.gef.ui.palette.PaletteViewer$PreferenceListener.refreshAllEditParts(PaletteViewer.java:79)
   at org.eclipse.gef.ui.palette.PaletteViewer$PreferenceListener.propertyChange(PaletteViewer.java:65)
   at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
   at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
   at org.eclipse.gef.ui.palette.DefaultPaletteViewerPreferences.firePropertyChanged(DefaultPaletteViewerPreferences.java:188)
   at org.eclipse.gef.ui.palette.DefaultPaletteViewerPreferences.handlePreferenceStorePropertyChanged(DefaultPaletteViewerPreferences.java:240)
   at org.eclipse.gef.ui.palette.DefaultPaletteViewerPreferences$PreferenceStoreListener.propertyChange(DefaultPaletteViewerPreferences.java:357)
   at org.eclipse.ui.preferences.ScopedPreferenceStore$3.run(ScopedPreferenceStore.java:375)
   at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
   at org.eclipse.ui.preferences.ScopedPreferenceStore.firePropertyChangeEvent(ScopedPreferenceStore.java:372)
   at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.initializeGraphicalViewer(DiagramEditorInternal.java:1164)
   at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.createGraphicalViewer(DiagramEditorInternal.java:424)
   at org.eclipse.gef.ui.parts.GraphicalEditor.createPartControl(GraphicalEditor.java:171)
   at org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette.createPartControl(GraphicalEditorWithFlyoutPalette.java:75)
   at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.createPartControl(DiagramEditorInternal.java:1588)
   at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
   at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
   at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
   at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768)
   at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760)
   at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2682)
   at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
   at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
   at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:365)
   at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:168)
   at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:229)
   at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:208)
   at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:274)
   at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:250)
   at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:373)
   at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:526)
   at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
   at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:845)
   at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
   at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
6 REPLIES 6

tiesebarrell
Champ in-the-making
Champ in-the-making
Can you provide some code of the class you created as a custom node?

gecos
Champ in-the-making
Champ in-the-making
package org.gecos;

import org.activiti.designer.integration.servicetask.AbstractCustomServiceTask;
import org.activiti.designer.integration.servicetask.annotation.Help;
import org.activiti.designer.integration.servicetask.annotation.Property;
import org.activiti.designer.integration.servicetask.annotation.Runtime;
import org.activiti.designer.integration.servicetask.PropertyType;

/**
* @author John Doe
* @version 1
* @since 1.0.0
*/
@Runtime(delegationClass = "org.gecos.runtime.GecosTaskJavaDelegation")
@Help(displayHelpShort = "Nuevo Objeto Transaccional", displayHelpLong = "Crea una nueva transaccion en el Sistema")
public class GecosTask extends AbstractCustomServiceTask {

  private static final String HELP_OT_GECOS = "Nombre de la Transacción a adjuntar";

  @Property(type = PropertyType.TEXT, displayName = "Nombre Objeto Transaccional", required = true)
  @Help(displayHelpShort = "Seleccione el nombre del objeto transaccional", displayHelpLong = HELP_OT_GECOS)
  private String nombreTransaccion;

  @Property(type = PropertyType.MULTILINE_TEXT, displayName = "Comentarios")
  @Help(displayHelpShort = "Comentarios", displayHelpLong = "Comentarios")
  private String comentarios;

  /*
   * (non-Javadoc)
   *
   * @see org.activiti.designer.integration.servicetask.AbstractCustomServiceTask #contributeToPaletteDrawer()
   */
  @Override
  public String contributeToPaletteDrawer() {
    return "Gecos BPMN";
  }

  @Override
  public String getName() {
    return "Tarea Gecos";
  }

  /*
   * (non-Javadoc)
   *
   * @see org.activiti.designer.integration.servicetask.AbstractCustomServiceTask #getSmallIconPath()
   */
  @Override
  public String getSmallIconPath() {
    return "icons/ico_gecos.png";
  }
}

tiesebarrell
Champ in-the-making
Champ in-the-making
gecos,

I've tested you class and it works fine for me. I think the problem you have is that the icon you're referencing isn't in the jar file, or not in the icons folder at the top level. I tested with a valid path and an invalid one and the invalid path threw the exact same exception you mentioned. So I'd check whether the icon is correctly included as you reference in the getSmallIconPath() method.

tiesebarrell
Champ in-the-making
Champ in-the-making
And since you pointed this out I feel the exception you get in this case is undesirable, so I've created an issue to help developers in the future: http://jira.codehaus.org/browse/ACT-467

gecos
Champ in-the-making
Champ in-the-making
Thanks for your help. I changed the class to the default package and finally the extension work.
Thanks again!

tiesebarrell
Champ in-the-making
Champ in-the-making
HTH Smiley Very Happy

I actually left the class in the org.gecos package, I just made sure the icon was in the jar.