Example/ Start Process via Application

634 views
Skip to first unread message

Christian

unread,
Sep 1, 2014, 4:56:03 AM9/1/14
to camunda-...@googlegroups.com
Hi,

I'm looking for a camunda example application.
The examples (twitter, invoice etc.) start in the camunda UI tasklist:
http://localhost:8080/camunda/app/tasklist/.

Any example there the process starts via application and not via tasklist?

Sebastian Menski

unread,
Sep 1, 2014, 5:30:02 AM9/1/14
to camunda-...@googlegroups.com, chbr...@gmail.com
Hey Christian,

what application do you mean? Do you mean a process application or another external application?

If you mean a process engine you could use the RuntimeService.

processEngine.getRuntimeService().startProcessInstanceByKey("testProcess");

If you have an external application you can use the REST API to start a process.

Cheers,
Sebastian

chbr...@gmail.com

unread,
Sep 1, 2014, 6:04:27 AM9/1/14
to camunda-...@googlegroups.com, chbr...@gmail.com

Hi Sebastian,

I want to make use of the Java API, so currently no REST API.

Is there any example to see it all working together?

Christian Lipphardt

unread,
Sep 1, 2014, 6:11:07 AM9/1/14
to camunda-...@googlegroups.com
Hi Christian,

You can start a process inside a method of your application like so

HashMap<String, Object> variables = new HashMap<String, Object>();
long customerId = 01234566;
variables.put("customer", customerId);

ProcessEngine defaultProcessEngine = BpmPlatform.getProcessEngineService().getDefaultProcessEngine();
RuntimeService runtimeService = defaultProcessEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testProcess", variables);

Be sure to import the camunda-engine jar in provided scope in maven.

Cheers,
Christian
> --
> You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
> To post to this group, send email to camunda-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/e78fbc78-6fd5-4ac9-9d59-92f0859ed031%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

signature.asc
Reply all
Reply to author
Forward
0 new messages