Search code examples
javajbpmbpmnkie

How to call a getter method in the Data Assignments I/O in a jbpm task?


In a jbpm process i recieve an object (of class Employee) from a rest call. I made a class in jbpm to handle this Employee and access all the properties

In the OnExit Action of the rest task I write the following code

kcontext.setVariable("processEmployee", myEmp);

in this way I put in processEmployee (a process variable) the employee retrieved from the rest call and stored now in a local variable. The above assignment works fine.

Now, it would be handy to access the employee properties in a simple way, such as by calling directly processEmployee.getEmail()

I can call processEmployee.getEmail() in an onExit action event and assign the returned value to another process variable of type string named employeeEmail, and then I can use this variable in the Assignmeent Data I/O panel.

But it would be much easier to avoid creating the employeeEmail variable and call processEmployee.getEmail() directly into the panel like this: enter image description here but the above does not work since the code is seen as a string.

Is there a way to call a method (such as myEmp.getEmail()) there?

Thanks.


Solution

  • You can write #{processEmployee.getEmail()}.

    The #{...} works as a sort of escape.