cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with UUID creation: key and version cut off

frauke
Champ in-the-making
Champ in-the-making
Hi everybody,

we are using Activiti 5.11 and we activated the UUID generation for the process ID.
Now we detected the following problem in class BpmnDeployer in method deploy:
When the generated process id is longer than 64 characters, the key and version information is cut off.
This causes problems in our application.


        String nextId = idGenerator.getNextId();
        String processDefinitionId = processDefinition.getKey()
          + ":" + processDefinition.getVersion()
          + ":" + nextId; // ACT-505
                  
        // ACT-115: maximum id length is 64 charcaters
        if (processDefinitionId.length() > 64) {         
          processDefinitionId = nextId;
        }


Do you have a solution for this?
Or other question: Is the key and version info needed during process execution?

Best regards
Frauke
4 REPLIES 4

trademak
Star Contributor
Star Contributor
What's exactly the problem you are facing. The logic just uses nextId as the process definition id, which should be fine.
Could you explain the issue in more details?

Best regards,

trademak
Star Contributor
Star Contributor
I see, yes you are right. I think the 64 characters limit is too strict. Could you create a JIRA issue?

Best regards,

frauke
Champ in-the-making
Champ in-the-making
Ok, I created a JIRA ticket, ACT-2144

frauke
Champ in-the-making
Champ in-the-making
Hi everybody,

now I found some code where the above problem matters:
I create a query on the history table like that:
<code>HistoricProcessInstanceQuery finishedSubprocesses = m_historyService
            .createHistoricProcessInstanceQuery()
            .processDefinitionKey(processKey)
            .superProcessInstanceId(m_processInstanceId)
            .finished();
</code>
This resulting statement is created by Activiti:
<code>select RES.* from ACT_HI_PROCINST RES
inner join ACT_RE_PROCDEF DEF on RES.PROC_DEF_ID_ = DEF.ID_
WHERE RES.PROC_DEF_ID_ like ? and RES.END_TIME_ is not NULL
and RES.SUPER_PROCESS_INSTANCE_ID_ = ? order by RES.ID_ asc LIMIT ? OFFSET ?
</code>
With the 'like' you assume that the process key will be part of the process definition key, but that is not so in the above use case.

Best regards
Frauke