cancel
Showing results for 
Search instead for 
Did you mean: 

Changing default task id

rashmis
Champ in-the-making
Champ in-the-making
Hi,

I have created the user-defined node of type 'Money Node' (as in User guide example). The Money node gets its id as "servicetask<n>" , n being the updated service task id for current instance of Activiti. I want to make this id as "subprocess<n>" instead of "servicetask<n>", which will be the next sub process id available. How can i do this ? I saw in the AbstractCustomServiceTask.java that the id gets generated by the method:

public final String getId() {
    return getClass().getCanonicalName();
  }

I cannot override this api as its final. So how can I work around this ? Any ideas please..  8-)
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Moved to designer forum

trademak
Star Contributor
Star Contributor
Hi,

Okay, there's I'll look if we can change that for the next release. Can you create a JIRA issue so that I won't forget it?

Best regards,

tiesebarrell
Champ in-the-making
Champ in-the-making
As much as I encourage extension, that piece of logic is not final for no reason. If you were to change the logic used there in the way you propose, you would effectively create a conflict with any subprocess nodes that get added to the diagram. The node you are adding *isn't* a subprocess (it's a customized *ServiceTask*) and you shouldn't therefore generate ids that end up in the same ID "space" as real subprocesses.

I don't see a reason to prevent people from doing this, so we can open it up (I propose a way to provide your own ID generator classes, similar to how it's done in JPA), but you should realize this has potential problems if you use it and don't make sure you won't get conflicts.