galen...@gmail.com
unread,Apr 2, 2015, 1:20:21 PM4/2/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to camunda-...@googlegroups.com
Hi,
I'm trying to find the best way to get a process definition key (i.e. the ACT_RE_PROCDEF.KEY_ valuue) from a DelegateExecution object.
++++++++++++++++++++++++++++++++++++++
String procDefKey = null;
List<DomElement> candEls = execution.getBpmnModelInstance().getDocument().getRootElement().getChildElements();
for (DomElement el : candEls) {
if (el.getLocalName().equals("process")) {
procDefKey = el.getAttribute("id");
break;
}
}
if (procDefKey == null) {
log.error("procDefKey not determined from model! ("+candEls.size() + " child els)");
for (DomElement el : candEls) {
log.warn("DomEl: localname = " + el.getLocalName());
}
}
++++++++++++++++++++++++++++++++++++
The above methodology seems to work, but once in a while (probably once out of every 5000 executions), the model only seems to have a "BPMNDiagram" element, and I get the following output:
++++++++++++++++++++++++++++++++++++++++
2015-04-02 10:07:54,203 ERROR ...( 268) - procDefKey not determined from model! (1 child els)
2015-04-02 10:07:54,204 WARN ...( 270) - DomEl: localname = BPMNDiagram
++++++++++++++++++++++++++++++++++++++++
So I have two questions:
1) Is there a more direct call I can use? I see execution.getProcessDefinitionId() and execution.getProcessBusinessKey(), but these are not the value I want...
2) Any explanation for the once-in-a-while incomplete model?
THanks,
Galen