Hi,
when i create a new person, a java function is called, using the fields bellow :

Java function uses getPerson() method from PersonService Class:
@Autowired
private AuthorityService authorityService;
@Override
public NodeRef createPatient(String idPatient, String nomPatient, String prenomPatient, Date dateDeNaissance) {
...
return personService.getPerson(userName);
}
But in my javascript, i need to get Node , not a nodeRef, so i use search.findNode() method like that :
var nodePat = createPatient(idPatient,PrenomPatient,nomPatient,dateNaissance);
//execution.setVariable("wfvd_patients" ,nodePat);
var node = search.findNode(nodePat)
execution.setVariable("wfvd_patients",node);
But i get the error " org.activiti.engine.ActivitiException: Exception while invoking TaskListener: Exception while invoking TaskListener: 02130054 Failed to execute supplied script: Passed value is not an instance of ActivitiScriptNode, cannot set variable value."
What is the best way to do it ?
Thank you