AnsweredAssumed Answered

Designer 5.11.1: @Property and @PropertyItems no longer work

Question asked by sjmo on Jan 10, 2013
Latest reply on Jan 11, 2013 by sjmo
Customized tasks (see code example below) which contains attributes has following problems:

1. Attribut defaultValue="…" of @Property has no influence
2. After dragging a task into the diagram the default value is not preselected (radios are not preselected, textfields are not pre filled).
A (wrong!) default value will be set after switching to another tab ("General" or so) and go back to the tab "Main config". After clicking into the free area of the diagram and go back again to check the prior selected value in the task - it is again unselected.
3. The order of the options (radiobutton and so on) is incorrect.

All this things was possible with 5.7. Due to another serious problems with the designer plugin (5.7) we are forced to use a newer version.

I spend a lot of time to figure out a workaround - in this case no chance.


package demo;

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


@Help(displayHelpShort = "Demo", displayHelpLong = "Demo")
public class DemoTask extends AbstractCustomServiceTask {
   
   @Help(displayHelpShort="bla", displayHelpLong="bla bla bla")
   @Property(order=1, required=true, type=PropertyType.RADIO_CHOICE, displayName="Option", defaultValue="c")
   @PropertyItems({"A", "a", "B", "b", "C", "c"})
   private String option;

   @Override
   public String contributeToPaletteDrawer() {
      return "Demo";
   }

   @Override
   public String getDescription() {
      return "Demo";
   }

   @Override
   public String getLargeIconPath() {
      return getSmallIconPath();
   }

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

   @Override
   public Integer getOrder() {
      return 1;
   }
   
   @Override
   public String getShapeIconPath() {
      return getSmallIconPath();
   }

   @Override
   public String getSmallIconPath() {
      return "archiv16.png";
   }
}

Outcomes