Custom Task translations not rendered

Hi everyone!

I have created an application that creates custom palettes and serviceTasks from a source definition based on this example; Flowable docs: add-task-process-palette

I have no issues with the palette.xml file, but the properties are not always rendered in flowable-design.

Let’s assume I have a component and an attribute as such;

<component id="demo.calculation.RaiseNonTrivialCalculationEvent"...>
  <attribute index="1" id="name"... />
</component>

Then in my properties file, I have the following entries;

demo.calculation.RaiseNonTrivialCalculationEvent.title=Component title
demo.calculation.RaiseNonTrivialCalculationEvent.description=Component Description
demo.calculation.RaiseNonTrivialCalculationEvent.name.title=Name
demo.calculation.RaiseNonTrivialCalculationEvent.name.description=The name of something

This works in some of the cases, but sometimes it looks as if no translation was provided and I only see a default key like property.name.title .
Is there a maximum length which should be taken into account when providing property keys?

This is another example of what I get as properties when not using the property.x.x syntax.
image

Thank you for your input!

Sidenote;
I’m aware of the title and description attributes that can be provided per attribute in the XML but I try not to use them as they clutter the code.

Hi @NicoVanBelle. This is the open source forum. As your question is about Flowable Design, the enterprise forum https://forum.flowable.com/ is a better place to ask these questions.

How are you building and adding the palette and translations? How do you bundle it?
Looking at your screenshot, some of the default translations are missing too. Do you see an error in the browser console?

Hi @joram!
Thank you for your reply.
I was not aware there were 2 fora, so thank you for the tip!

I’m building the palette and translation files from a java app, and the output is a folder structure as described in the tutorial.

com/flowable/addons/palette/ which contains my xml files (e.g. calculation-domain.process.palette.xml)
com/flowable/addons/palette/i18nwhich contains my properties files
com/flowable/addons/palette/component-presentations/palette-icons which contain svg and png images

The generated XML has a reference to the properties file as such:

<palette id="calculation-domain-palette" hide-parent-palette-elements="true"
         xmlns="http://www.edorasware.com/schema/vis/palette"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.edorasware.com/schema/vis/palette http://www.edorasware.com/schema/vis/edoras-vis-process-palette-2.0.60.xsd"
         apply-patch-to-palette="flowable-process-palette"
         resource-bundle="calculation-domain-messages">

and the referenced translation file has name calculation-domain-messages.properties.
Example contents of a translation file;

# Palette group headers for functional area Calculator Demo

calculator-demo-palette-tasks-client.title=Calculator Demo
calculator-demo-palette-tasks-impl.title=Calculator Demo (Impl)

# Await MeaningOfLifeCalculated Event

demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.title=Await MeaningOfLifeCalculated Event
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.description=Waits for a Business Event to happen
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.eventType.title=Event Type
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.eventType.description=Type of BusinessEvent to wait for
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.correlationKey.title=Correlation Key
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.correlationKey.description=The field used to identify the expected event we wait for
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.correlationValue.title=Correlation Value
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.correlationValue.description=The value used for correlating the expected event
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.eventVariable.title=Event Variable
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.eventVariable.description=The process variable in which the event information will be available
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.mapping.title=Incoming payload mapping
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.mapping.description=Mapping of incoming payload to process variables
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.businessKey.title=New value for process instance businessKey
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.businessKey.description=JUEL or JsonPath expression that determines a new Business Key for the process instance

Example contents of the XML file:

<group id="calculator-demo-palette-tasks-client" index="300">
    <component id="demo.calculation.AwaitMeaningOfLifeCalculatedEventTask" extends="ServiceTask"
               attribute-groups="baseAttributes,activitiMultiInstanceAttributes"
               presentation-id="await-event.presentation">
        <attribute index="1" id="name" value="Await MeaningOfLifeCalculated" category="common" optional="true"/>
        <attribute index="2" id="eventType" type="SimpleText" value="demo.calculation.MeaningOfLifeCalculated" category="edoras" export="true" extension-element="true" readonly="true"/>
        <attribute index="3" id="correlationKey" type="ComboBox" value="" category="edoras" optional="true" export="true" extension-element="true">
            <items>
                <item id="empty" title="&lt;none&gt;" value=""/>
                <item id="user" title="user" value="$.payload.user"/>
            </items>
        </attribute>
        <attribute index="4" id="correlationValue" type="SimpleTextExpression" category="edoras" optional="true" export="true" extension-element="true"/>
        <attribute index="5" id="mapping" category="edoras" type="Complex" export="true" field-extension="false" xml-name="mapping">
            <complex-items>
                <complex-item id="variableName" type="SimpleTextExpression" optional="false" value="" width="250" />
                <complex-item id="variableType" type="Combobox" value="" category="edoras" optional="false" export="true" extension-element="true">
                    <items>
                        <item id="string"  title="String"  value="string"/>
                        <item id="number"  title="Number"  value="number"/>
                        <item id="integer" title="Integer" value="integer"/>
                        <item id="boolean" title="Boolean" value="boolean"/>
                        <item id="json"    title="Json"    value="json"/>
                    </items>
                </complex-item>
                <complex-item id="expressionOrJsonPath" value="" width="250" optional="true">
                    <validation-rules>
                        <reserved-words scope="root,parent,self" value="id,definitionId,type,state,creationTime,updateTime,currentUser,isUserInGroup,isUserInGroups,isUserInAllGroups,i18n" />
                    </validation-rules>
                </complex-item>
                <complex-item id="defaultValue" type="SimpleTextExpression" optional="true" value="" width="250" />
            </complex-items>
        </attribute>
        <attribute index="6" id="eventVariable" value="event" type="SimpleText" category="edoras" optional="true" export="true" extension-element="true"/>
        <attribute index="7" id="businessKey" value="" type="SimpleText" category="edoras" optional="true" export="true" extension-element="true"/>
        <attribute id="overwrite" visible="false"/>
        <attribute id="tasktype" value="Service" visible="false"/>
        <attribute id="delegateexpression" value="${awaitBusinessEventTask}" visible="false" constant="true"/>
        <attribute id="expression" visible="false"/>
        <attribute id="resultvariable" visible="false"/>
        <attribute id="class" visible="false"/>
        <attribute id="classfields" value="" visible="false"/>
        <attribute id="servicetasktriggerable" value="true" visible="false"/>
        <attribute id="servicetaskUseLocalScopeForResultVariable" value="" visible="false"/>
        <attribute id="genericproperty" value="" visible="false"/>
    </component>
</group>

I bundle it by making creating a jar from the com root folder. I then place it directly in the webservers \lib folder (locally I’m running a Tomcat 9) and I reboot the webserver from the console.
I see logs nor exceptions coming from the PaletteDeployer or any of that matter. The palette is rendered ok, groups and components are translated in the accordion menu as they should, but the component’s attributes/properties are not translated. They’re usually only visible as property.xxx.title in the detail screen.

This post can be closed, I found the issue.

Apparently Either;

  • a key that contains more than 3 dots is not picked up by the designer
    OR

  • a component id cannot contains dots is not well matched for property translation

I changed this;
demo.calculation.AwaitMeaningOfLifeCalculatedEventTask.eventType.title
To this;
democalculationAwaitMeaningOfLifeCalculatedEventTask.eventType.title

and now all is working.