Create a map of variables and execute a user task remotly

I need to execute the user task from a remote java app and as I know the proper way is to use processAPI :
processAPI.executeUserTask(long userTaskInstanceId, Map<String, Serializable> inputs)

the problem is that i dont’t know how to create Map<String, Serializable> inputs, I have tried puting variable names and values (k,v) in map but engine throws an exeption that says missing input…
I tried to understand how the engine does it when we use the protal but i couldn’t get my answer.
any help is appreciated

Hi,

Here is some code to create and start a process…you can use this to model your executeUserTask.

Map processData = new HashMap(); processData.put("whoIsDoingThisTask", username); //user data processData.put("whoIsTheSender", whoIsTheSender); //user data processData.put("additionalText", additionalText); //user data

ProcessInstance processInstance = processAPI.startProcess(processId, processData);

regards
Seán

PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply.

Note that it should not be variable name but contact input name as defined in the “Execution” → “Contract” tab in the Studio.