Hi,
I’m trying to get access to a row in a Businnes Object from an external process (I cannot access from context) but I cannot do this, I get the following exception:
{"exception":"class org.bonitasoft.engine.bpm.process.ProcessExecutionException","message":"USERNAME=walter.bates | org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceCreationException: PROCESS_DEFINITION_ID=5085018177039517831 | PROCESS_NAME=Edit supplier | PROCESS_VERSION=0.0 | org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: groovy.lang.MissingMethodException: No signature of method: static com.company.model.SupplierDAO.findById() is applicable for argument types: (java.lang.Long) values: [49]\nPossible solutions: findAll(), find(), findAll(groovy.lang.Closure), find(groovy.lang.Closure)"}
This is my code:
import com.company.model.Supplier;
import com.company.model.SupplierDAO;
Supplier sp = SupplierDAO.findById(Long.parseLong(supplierSupplier.get(“persistenceId”)));
sp.setName(supplierSupplier.get(“name”));
sp.setDescription(supplierSupplier.get(“description”));
return sp;
What’s wrong with my code?, am I trying to access properly?
===== UPDATE =====
This is so frustrating, I’m trying to access via query, but I get this error:
Error: {"exception":"class org.bonitasoft.engine.bpm.process.ProcessExecutionException","message":"USERNAME=walter.bates | org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceCreationException: PROCESS_DEFINITION_ID=5317399391776196580 | PROCESS_NAME=Edit supplier | PROCESS_VERSION=0.0 | org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: PROCESS_INSTANCE_ID=3 | Declared return type class com.company.model.Supplier is not compatible with evaluated type class com.company.model.Supplier_$$_jvst635_9a for expression Supplier.findById"}
???
===============
Thanks in advance.