// compile extensions
for (Extension e : _processDef.getExtensions()) {
compileExtension(e);
}
OScope procesScope = new OScope(_oprocess, null);
procesScope.name = "__PROCESS_SCOPE:" + process.getName();
procesScope.debugInfo = createDebugInfo(process, null);
_oprocess.procesScope = compileScope(procesScope, process, new Runnable() {
public void run() {
if (process.getRootActivity() == null) {
throw new CompilationException(__cmsgs.errNoRootActivity());
}
// Process custom properties are created as variables associated
// with the top scope
if (_customProcessProperties != null) {
for (Map.Entry<QName, Node> customVar : _customProcessProperties.entrySet()) {
final OScope oscope = _structureStack.topScope();
OVarType varType = new OConstantVarType(_oprocess, customVar.getValue());
OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
ovar.name = customVar.getKey().getLocalPart();
ovar.declaringScope = oscope;
ovar.debugInfo = createDebugInfo(null, "Process custom property variable");
oscope.addLocalVariable(ovar);
if (__log.isDebugEnabled())
__log.debug("Compiled custom property variable " + ovar);
}
}
_structureStack.topScope().activity = compile(process.getRootActivity());