Passing process Variables to Event Subprocess

How to pass process Variables to Event Subprocess?

1 Like

Hi @aravindhrs,

they have to be passed as payload to the start event. Depending on the event type it differs how to pass them.

Hope this helps, Ingo

1 Like

Hi @Ingo_Richtsmeier, I was already passing those process variables to start event. But not able to access in event subprocess. I was able to see those variables in cockpit

I was trying to set date value to the timer start event in event sub process.

But i was getting err. Check this thread and let me know how to solve this isuue.

Hi @aravindhrs,

you only have to pass the variable when you start the overall process instance.

No listener needed.

This should start successfully:

ProcessInstance processInstance = processEngine().getRuntimeService().startProcessInstanceByKey(PROCESS_DEFINITION_KEY,
        withVariables("taskResolveDate", subprocessStartDate,
            "candidateUsers", "demo",
            "candidateGroups", "management"));

Cheers, Ingo

2 Likes

Thanks for the reply. But I’m using Camunda Rest API :frowning:

Have any beginner example to create Java code to connect camunda instead of API?
thanks i

Hi @aravindhrs,

this should be your call: https://docs.camunda.org/manual/7.10/reference/rest/process-definition/post-start-process-instance/#starting-a-process-instance-at-its-default-initial-activity.

Cheers, Ingo

yeah, using that api only i was initiated the workflow

Hi @Learn_Hadoop,

sorry, I didn’t understand your question. Could you please rephrase it and perhaps add a example to make it more clear?

If you are looking for getting started guides, you can find them here: https://docs.camunda.org/get-started/

Thank you, Ingo

I have solved this issue in post: