I am a beginner in Bonita working on a project
My requirement is to get logged in username and current user system date time
For Username: In business variable default value script I have tried writing the below code
def userName= apiAccessor.getIdentityAPI().getUser(userId).getUserName();
//but how can i get userId as it is an instantiation Form
For current user system date time :I have tried below code in business variable default value script
import java.time.*
LocalDateTime currentdatetime = LocalDateTime.now();
configBdgtWiseApproverVar.createdOn = currentdatetime
getting below error
Caused by: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.codehaus.groovy.runtime.typehandling.GroovyCastException with message = Cannot cast object '2020-08-11T18:46:29.483977300' with class 'java.time.LocalDateTime' to class 'java.time.OffsetDateTime'
Please suggest