* @throws BpmnParseException if the a attribute is missing or the script cannot be processed
*/
public static ExecutableScript parseCamundaScript(Element scriptElement) {
String scriptLanguage = scriptElement.attribute("scriptFormat");
if (scriptLanguage == null || scriptLanguage.isEmpty()) {
throw new BpmnParseException("Missing attribute 'scriptFormatAttribute' for 'script' element", scriptElement);
}
else {
String scriptResource = scriptElement.attribute("resource");
String scriptSource = scriptElement.getText();
try {
return ScriptUtil.getScript(scriptLanguage, scriptSource, scriptResource, getExpressionManager());
}
catch (ProcessEngineException e) {
throw new BpmnParseException("Unable to process script", scriptElement, e);
}
}
}