// compile extensions
for (Extension e : _processDef.getExtensions()) {
compileExtension(e);
}
OScope processScope = new OScope(_oprocess, null);
processScope.atomicScope = _oprocess.atomicScope;
processScope.name = "__PROCESS_SCOPE:" + process.getName();
processScope.debugInfo = createDebugInfo(process, null);
_oprocess.processScope = compileScope(processScope, 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());