ProcessInstanceId groovy script

1
0
-1

I am tryting to retrieve a particular id of the person who has started a process with the code below.
id=apiAccessor.processAPI.getProcessInstance(processInstanceId).startedBy

I get an error as shown below.

org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Declared return type class java.lang.Long is not compatible with evaluated type class java.lang.Integer for expression processInstanceId

Any Idea of how i can resolve this?

Regards.
A.

2 answers

1
0
-1
This one is the BEST answer!

Hello,

Something like this works perfectly well :

long userID = processAPI.getProcessInstance(processInstanceId).startedBy
(do not forget the type long)

Also, check the "return type" at the bottom of the Groovy Script Editor window.
Set it to the type you want to return for this variable or script.

Regards,
Raphaël.

1
0
-1

Thanks Raphael. It does work.
But in some cases, i cant change the return type.By default it is java.lang.string.

Regards
A.

Comments

Submitted by raphael.le-gora... on Fri, 07/22/2016 - 15:48

Do not forget to mark the topic as resolved on my answer.

:)

Notifications