cancel
Showing results for 
Search instead for 
Did you mean: 

Need something like activiti:formProperty for ServiceTask. Why is it not available?

vtsurkan
Champ in-the-making
Champ in-the-making
I am thinking of using ServiceTask with arbitrary properties that would be great to have in process definition.

Unfortunately ServiceTask only allows "activiti:field" and that forces your ServiceTask Java class to have only predefined "fields" - properties, basically you can't handle arbitrary number and named "properties" with that layout. You need "activiti:formProperties" or something like it for that.

You can do it with the "pseudo" lists like:

<activiti:field name="propNames" stringValue="name1, name2, …"></activiti:field>
<activiti:field name="propValues" expression="${val1}, ${val2}, …" ></activiti:field>

Then split the lists in the code and assign: name1=val1; name2=val2, …

But this looks real ugly Smiley Sad (it's OK actually, but feels somewhat unprofessional and "hacky")

Is there a way to get that functionality.

I am new to Activiti, so maybe missing some simple thing. Hoping someone already solved that problem.

Thanks
VT
1 REPLY 1

trademak
Star Contributor
Star Contributor
A service task can have any extension element you define. These extension elements are parsed by Activiti and available in the BpmnModel instance of a process definition. The RepositoryService has a method to get the BpmnModel with a process definition identifier.

Best regards,