AnsweredAssumed Answered

Bug with 5.11.1 Designer Custom Service Task?

Question asked by ryanberg1 on Jan 9, 2013
Latest reply on Apr 17, 2013 by jjfutt
Hello,

It appears that in 5.11.1 (possibly 5.11.*) there is a bug where the activiti:class attribute is not set on custom service tasks.

For example, when dropping a custom service task from the palatte, the only attributes set are:

<serviceTask id="servicetask1" name="Test Concat" activiti:extensionId="com.foo.extensions.test.TestConcatTask"></serviceTask>

where the appropriate attributes should be:

<serviceTask id="servicetask1" name="Test Concat" activiti:extensionId="com.foo.extensions.test.TestConcatTask" activiti:class="com.foo.tasks.test.TestConcatTask"></serviceTask>

for this extension code:

package com.foo.extensions.test;

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.Runtime;

@Runtime(delegationClass = "com.foo.extensions.test.TestConcatTask")
public class TestConcatTask extends AbstractCustomServiceTask
{
    @Property(type = PropertyType.TEXT, displayName = "Arg 1", required = true, order = 1)
    @SuppressWarnings("unused")
    private String arg1;
   
    @Property(type = PropertyType.TEXT, displayName = "Arg 2", required = true, order = 2)
    @SuppressWarnings("unused")
    private String arg2;

    /**
     * Returns the name of this Custom Service Task.
     *
     * @return The name of this Custom Service Task.
     */
    @Override
    public String getName() {
        return "Test Concat";
    }

    /**
     * Returns the name of the Palette Drawer in Activiti Designer
     *
     * @return The name of the Palette Drawer in Activiti Designer
     */
    @Override
    public String contributeToPaletteDrawer() {
        return "TEST";
    }

    @Override
    public String getSmallIconPath() {
        return "icons/coins.png";
    }
}

To make it work, the activiti:class attribute must be manually added to the XML, but is subsequently obliterated after any saves using the graphical designer.

Thank you.
-Ryan

Outcomes