cancel
Showing results for 
Search instead for 
Did you mean: 

how to add custom objects to the process instance?

luisalves00
Champ in-the-making
Champ in-the-making
how to add custom objects to the process instance?

this work:

variableMap.put("assignee", authorizatorObject.getAuthorizator());‍

this won't
variableMap.put("authorizatorObject", authorizatorObject);‍

because activiti doesn't know my object!?!?

or on the process definition i need to declare authorizatorObject variable?

want to have the authorizatorObject on my process model
4 REPLIES 4

luisalves00
Champ in-the-making
Champ in-the-making
The object need to be Serializable?

changed the object to a JPA entity and works..

Problem solved

jbarrez
Star Contributor
Star Contributor
Normally, Serializable is enough. JPA will of course also work.

luisalves00
Champ in-the-making
Champ in-the-making
from a Task object how can I get to this variable?
to be able to mess with the object on a given userTask…

luisalves00
Champ in-the-making
Champ in-the-making
Solved:

//get pedidoAutorizacao object from the process
            pedidoAutorizacao = (PedidoAutorizacao) getActivitiEngine().getRuntimeService().getVariable(task.getProcessInstanceId(), "authRequest");