Process Instance ID in text field?

1
0
-1

Hi.

I have a process in 6.3.0 version in which i generate tickets of support and i want that every ticket has an identifier so i have a field named "FOLIO" what i want to do is when te process start in that field appear the processinstanceid and use it as the identifier. eg. Ticket: 231.

Hope you can help me!!

Thanks.

2 answers

1
0
-1

I have used this groovy script to get the id of current process. You can use a field that use its initial value a value that got from the groovy script.

def process = apiAccessor .getProcessAPI().getProcessInstance(processInstanceId);
return process.id.toString();

1
0
-1

Hi Rodrigo,

I assume that a ticket is a case (process instance) and that a field is a variable of your process. Bonitasoft Engine generates an internal ID named process instance ID for any created case. If you want to use this ID (which is unique), you can easily access its value within a Groovy script ("processInstanceId" in the right drop down selector in the Groovy editor). Then, in your case, FOLIO variable can be initialized with this value if you want.

Thanks,

Pierrick

Notifications