I succesful implemented my Process in bonita and I am could also make an succesful run. I just can't start the process due to the error message in the description.

1
0
-1

USERNAME=walter.bates | org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceCreationException: PROCESS_DEFINITION_ID=5581441738116941897 | PROCESS_NAME=JobSearch | PROCESS_VERSION=1.0 | 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 \u0027\u0027 with class \u0027java.lang.String\u0027 to class \u0027java.lang.Float\u0027\r\nExpression : SExpressionImpl [name=init_jobData(), content=def jobDatavar = new com.company.model.jobData()\n\n\n\njobDatavar.Message = \u0022\u0022\n\njobDatavar.Name = \u0022\u0022\n\njobDatavar.Nationality = \u0022\u0022\n\njobDatavar.Results = \u0022\u0022\n\njobDatavar.Experience = \u0022\u0022\n\njobDatavar.Status = \u0022\u0022\n\njobDatavar.Title = \u0022\u0022\n\n\n\nreturn jobDatavar, returnType=com.company.model.jobData, dependencies=[], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]

1 answer

1
0
-1

It seems that the script you are using to set the initial value of your business variable is trying to use a String (text) value from your contract input to initialize an attribute of your business variable that is of type Float (decimal number): Cannot cast object '' with class 'java.lang.String' to class 'java.lang.Float'.

So I recommend to review the type of contract inputs and compare them with the business object attributes type to make sure they match. In the Groovy script used to set the default value of the business variable you can do some type conversion if needed.

You can also choose to use the Bonita Studio assistant to create the contract based on your business data using the button "Add from data..." in order to have a default value script generated for you.

If you cannot find the issue in your script please share the business data definition and the default value script.

Also note that it is usually a good practice to start with an upper case letter for business object definition e.g.: "JobData" and lower case for variable e.g. "myJobData".

Notifications