Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

Stardust/Knowledge Base/API/ExamplesofAPIUsage/StartProcess

Start a Process


Creating and starting a process instance is quite easy via the API. Each process instance will process its activity instances until it has to wait on an external event like a JMS response, a mail or a user interaction.


You need an Initialized workflow service and the id of the process definition you want to start. Reference Model.

Stardust Embedded API Start Process


Exception handling

To keep the example code clear the exception handling is very simple. If you use this code productive, please add appropriate exception handling!

Missing parts

The missing code fragments ([...]) can be found here.

import ag.carnot.workflow.runtime.ProcessInstance;
import [...];
public class WikiProgram {
	public static void main(String[] unused) {
		try {
		    ProcessInstance lProcessInstance = startProcess();
			// Do stuff with the process instance here
		} finally {
	static ProcessInstance startProcess() {
		ProcessInstance lProcessInstance = workflowService.startProcess("DoWhileLoop", Collections.EMPTY_MAP, true);
		return lProcessInstance;
	static void init() {[...]}
	static void uninit() {[...]}

As you can see, the API call to start the process is quite simple

  • Just provide the ID of the process definition.
  • As long as you don't need any in data you can provide an empty map. Otherwise you can inject your data via this collection.
  • The started process instance will proceed until it reaches an interactive activity (or until it has to wait for an external event).

Back to the top