Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCustom Task creation name
https://www.eclipse.org/forums/index.php/mv/msg/635039/1228630/#msg_1228630
I declared a custom task "MyTask" based on the standard BPMN2 ScriptTask. I managed to modify its appearance by implementing some methods in my feature container, but I am not able to change its name at creation time. In my case, I would like to name it "MyTask 1" instead of "Script Task 1".
Is it possible to customize the name of the newly created custom task ?
Thanks]]>Cédric Casenove2014-01-07T16:59:10-00:00Re: Custom Task creation name
https://www.eclipse.org/forums/index.php/mv/msg/635039/1228652/#msg_1228652
Be aware, however, that the trailing sequence number will not be automatically incremented each time you add a new task.
If that doesn't work, you can try changing the name in your AddFeature.
HTH,
Bob]]>Robert Brodt2014-01-07T18:09:08-00:00Re: Custom Task creation name
https://www.eclipse.org/forums/index.php/mv/msg/635039/1229326/#msg_1229326
finally I override the add() method of my AddFeature to modify the name generated during the creation of the business object. In the create() method of my CreateFeature, I put a property in the context before calling AbstractCreateFlowElementFeature.create(). Then I retrieve this property in the add() method of my AddFeature to know if the object is being created or simply added. I don't know if there is a better solution but it seems to work.
Thanks for your help !]]>Cédric Casenove2014-01-09T07:54:26-00:00Re: Custom Task creation name
https://www.eclipse.org/forums/index.php/mv/msg/635039/1229435/#msg_1229435
I'm glad it worked. Graphiti Context properties seems to be the best way to communicate state information between the different Features, so your approach is the right one