Business Key in Cockpit

478 views
Skip to first unread message

jonle...@gmail.com

unread,
Apr 30, 2014, 3:23:43 AM4/30/14
to camunda-...@googlegroups.com
Hi all,

Would like to know how to set the business key which will be showed in Cockpit? The purpose is to ease the searching on the specific record (business key can put more meaningful word) rather than refer to the instance ID.

Thanks alot!


Regards,
FPL

Christian Lipphardt

unread,
Apr 30, 2014, 3:54:39 AM4/30/14
to camunda-...@googlegroups.com
Hi FPL,

If you use the Java API to start your processes, there exist several overloaded methods in RuntimeService for each startProcessInstanceBy... which allows to set the business key.

Eg. RuntimeService.
 - startProcessInstanceByKey(String processDefinitionKey, String businessKey);
 - startProcessInstanceByKey(String processDefinitionKey, String businessKey, Map<String, Object> variables);
 - startProcessInstanceById(String processDefinitionId, String businessKey);
 - startProcessInstanceById(String processDefinitionId, String businessKey, Map<String, Object> variables);
 - startProcessInstanceByMessage(String messageName, String businessKey);
 - startProcessInstanceByMessage(String messageName, String businessKey, Map<String, Object> processVariables);

Same goes for the REST API.

Be aware that you can only set the businessKey when you start the process instance. It cannot be added later.

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/63d51237-2336-469e-a859-95a08bcce3ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jonle...@gmail.com

unread,
Apr 30, 2014, 4:04:49 AM4/30/14
to camunda-...@googlegroups.com
Hi Christian Lipphardt,

Thanks for your reply. May I know how to set it in REST API? As our system using the following command to start the camunda workflow.

http://{0}:{1}/engine-rest/process-definition/{2}/start


Thanks!

Regards,
FPL

hassan....@gmail.com

unread,
Apr 30, 2014, 4:57:42 AM4/30/14
to camunda-...@googlegroups.com, jonle...@gmail.com
You can see the following example on the RestApi docs

http://docs.camunda.org/latest/api-references/rest/#process-definition-start-process-instance-example

Request
POST /process-definition/aProcessDefinitionId/start

Request body:

{"variables":
{"aVariable" : {"value" : "aStringValue", "type": "String"},
"anotherVariable" : {"value" : true, "type": "Boolean"}},
"businessKey" : "myBusinessKey"
}

Reply all
Reply to author
Forward
0 new messages