Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Custom Task creation name
Custom Task creation name [message #1228630] Tue, 07 January 2014 16:59 Go to next message
Cédric Casenove is currently offline Cédric CasenoveFriend
Messages: 22
Registered: December 2013
Junior Member
Hi,

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
Re: Custom Task creation name [message #1228652 is a reply to message #1228630] Tue, 07 January 2014 18:09 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

If you are using the <customTask> extension in your plugin.xml, you can simply initialize the name there:

         <property
               name="name"
               value="My Task 1">
         </property>


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
Re: Custom Task creation name [message #1229326 is a reply to message #1228652] Thu, 09 January 2014 07:54 Go to previous messageGo to next message
Cédric Casenove is currently offline Cédric CasenoveFriend
Messages: 22
Registered: December 2013
Junior Member
Hi Bob,

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 !
Re: Custom Task creation name [message #1229435 is a reply to message #1229326] Thu, 09 January 2014 12:46 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Cédric,

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 Smile

Cheers,
Bob
Previous Topic:extension points
Next Topic:org.eclipse.bpmn2.modeler.examples.modelreader project
Goto Forum:
  


Current Time: Tue Mar 19 08:54:19 GMT 2024

Powered by FUDForum. Page generated in 0.03047 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top