Issue when creating a Variable with a Java Object


Im trying to start a new instance process, with a process Variable type “document”, which a Java class I created. But once I execute the method " runtimeService.startProcessInstanceByKey", I get the following error:

couldn’t find a variable type that is able to serialize Document

It is a simple code to start my new instance:

public InstanceProcessDto registerNewCase(NewCase newCase) {

    Map<String, Object> variables = new HashMap<String, Object>();
    Document oDocuments = new Documento();

   variables.put("documents", oDocuments);
   variables.put("statusCase", newCase.getStatusCase());

    ProcessInstance processInstance =
            runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY, variables); 


Java objects must be serializable in order to store them in a workflow variable. For simple objects, you can use the Serializable marker interface (i.e. Documento implements Serializable).

Thank you jwashington, it (Documento implements Serializable) solved my problem! Im actually storing a List and it works perfect.