/** * @return Static DU version number generated from DU name. -1 when package doesn't use versioning. */ public long getStaticVersion() { return BpelCompiler.getVersion(getName()); }
private OActivity compileActivity(final boolean doLinks, final Activity source) { final ActivityGenerator actgen = findActivityGen(source); final OActivity oact = actgen.newInstance(source); oact.name = createName(source, "activity"); oact.debugInfo = createDebugInfo(source, "Activity body for " + source); _compiledActivities.add(oact); compile(oact, source, new Runnable() { public void run() { if (doLinks) compileLinks(source); actgen.compile(oact, source); } }); return oact; }
public OActivity compile(final Activity source) { if (source == null) throw new IllegalArgumentException("null-argument"); boolean previousSupressJoinFailure = _supressJoinFailure; switch (source.getSuppressJoinFailure()) { case NO: _supressJoinFailure = false; break; case YES: _supressJoinFailure = true; break; } OActivity compiled; try { compiled = (source instanceof ScopeLikeActivity) ? compileSLC((ScopeLikeActivity) source, new OScope.Variable[0]) : compileActivity(true, source); compiled.suppressJoinFailure = _supressJoinFailure; } finally { _supressJoinFailure = previousSupressJoinFailure; } if (__log.isDebugEnabled()) __log.debug("Compiled activity " + compiled); return compiled; }
public void run() { switch (_processDef.getBpelVersion()) { case BPEL11: oevent.variable = resolveMessageVariable(onEvent.getVariable()); break; case BPEL20_DRAFT: varType = resolveMessageType(onEvent.getMessageType()); else if (onEvent.getElement() != null) varType = resolveElementType(onEvent.getElementType()); oevent.partnerLink = resolvePartnerLink(onEvent.getPartnerLink()); oevent.operation = resolveMyRoleOperation(oevent.partnerLink, onEvent.getOperation()); oevent.messageExchangeId = onEvent.getMessageExchangeId(); oevent.route = onEvent.getRoute(); OScope.CorrelationSet cset = resolveCorrelationSet(correlation.getCorrelationSet()); resolvePropertyAlias(oevent.variable, property.name); oevent.activity = compile(onEvent.getActivity());
setResourceFinder(rf); _processURI = process.getURI(); _processDef = process; _oprocess.constants = makeConstants(); _oprocess.debugInfo = createDebugInfo(process, "process"); recoveredFromError(process, new CompilationException(__cmsgs.errProcessNamespaceNotSpecified())); } else { _oprocess.targetNamespace = _processDef.getTargetNamespace(); recoveredFromError(process, new CompilationException(__cmsgs.errProcessNameNotSpecified())); } else { _oprocess.processName = _processDef.getName(); _konstExprLang.debugInfo = createDebugInfo(_processDef, "Constant Value Expression Language"); _konstExprLang.expressionLanguageUri = "uri:www.fivesight.com/konstExpression"; _konstExprLang.properties.put("runtime-class", compile(_processURI, imprt); } catch (CompilationException bce) { recoveredFromError(imprt, bce); for (Definition4BPEL def : defs) { for (Property property : def.getProperties()) { compile(property); compile(propertyAlias);
case BPEL20: compiler = new BpelCompiler20(); compiler.setResourceFinder(wf); if (_bpel11wsdl != null) { CompilationMessage cmsg = __cmsgs.warnWsdlUriIgnoredFor20Process(); case BPEL20_DRAFT: compiler = new BpelCompiler20Draft(); compiler.setResourceFinder(wf); if (_bpel11wsdl != null) { CompilationMessage cmsg = __cmsgs.warnWsdlUriIgnoredFor20Process(); case BPEL11: compiler = new BpelCompiler11(); compiler.setResourceFinder(wf); if (_bpel11wsdl != null) { compiler.addWsdlImport(new URI(_bpelFile.getName()), _bpel11wsdl,null); } else { CompilationMessage cmsg = __cmsgs.errBpel11RequiresWsdl(); throw new CompilationException(cmsg); compiler.setCompileListener(clistener); if (_compileProperties != null) { if (_compileProperties.get(PROCESS_CUSTOM_PROPERTIES) != null) compiler.setCustomProperties((Map<QName, Node>) _compileProperties.get(PROCESS_CUSTOM_PROPERTIES)); oprocess = compiler.compile(process,wf,version);
switch (src.getKind()) { case ELEMENT: varType = resolveElementType(src.getTypeName()); break; case MESSAGE: varType = resolveMessageType(src.getTypeName()); break; case SCHEMA: varType = resolveXsdType(src.getTypeName()); break; default: ovar.debugInfo = createDebugInfo(src, null); ovar.from=null; ovar.extVar = compileExtVar(src);
private void compile(TerminationHandler terminationHandler) { OScope oscope = _structureStack.topScope(); oscope.terminationHandler = new OTerminationHandler(_oprocess, oscope); oscope.terminationHandler.name = "__terminationHandler:" + oscope.name; oscope.terminationHandler.debugInfo = createDebugInfo(terminationHandler, null); if (terminationHandler == null) { oscope.terminationHandler.activity = createDefaultCompensateActivity(null, "Auto-generated 'compensate all' pseudo-activity for default termination handler on " + oscope.toString()); } else { _recoveryContextStack.push(oscope); try { oscope.terminationHandler.activity = compile(terminationHandler.getActivity()); } finally { _recoveryContextStack.pop(); } } }
private void compileLinkSource(LinkSource linksrc) { OLink ol = resolveLink(linksrc.getLinkName()); assert ol != null; ol.debugInfo = createDebugInfo(linksrc, linksrc.toString()); if (ol.source != null) throw new CompilationException(__cmsgs.errDuplicateLinkSource(linksrc.getLinkName()).setSource(linksrc)); ol.source = _structureStack.topActivity(); ol.transitionCondition = linksrc.getTransitionCondition() == null ? constantExpr(true) : compileExpr(linksrc .getTransitionCondition()); _structureStack.topActivity().sourceLinks.add(ol); _structureStack.topActivity().outgoingLinks.add(ol); }
private OProcess.OPropertyAlias compile(PropertyAlias src) { OProcess.OProperty property = resolveProperty(src.getPropertyName()); OProcess.OPropertyAlias alias = new OProcess.OPropertyAlias(_oprocess); alias.debugInfo = createDebugInfo(_processDef, "PropertyAlias " + src.getPropertyName() + " for " + src.getMessageType()); if (src.getMessageType() == null){ throw new CompilationException(__cmsgs.errAliasUndeclaredMessage(src.getPropertyName(), src.getQuery().getPath())); } OMessageVarType messageType = resolveMessageType(src.getMessageType()); OVarType rootNodeType = messageType; alias.varType = messageType; // bpel 2.0 excludes declaration of part; // bpel 1.1 requires it if (src.getPart() != null) { alias.part = messageType.parts.get(src.getPart()); if (alias.part == null) throw new CompilationException(__cmsgs.errUnknownPartInAlias(src.getPart(), messageType.messageType.toString())); rootNodeType = alias.part.type; } if (src.getQuery() != null) alias.location = compileExpr(src.getQuery(), rootNodeType, null, new Object[1]); property.aliases.add(alias); alias.debugInfo = createDebugInfo(_processDef, src.getMessageType() + " --> " + src.getPropertyName()); return alias; }
oalarm.debugInfo = createDebugInfo(onAlarm, "OnAlarm Event Handler: " + onAlarm); oalarm.forExpr = compileExpr(onAlarm.getFor()); } else if (onAlarm.getFor() == null && onAlarm.getUntil() != null) { oalarm.untilExpr = compileExpr(onAlarm.getUntil()); } else if (onAlarm.getFor() != null && onAlarm.getUntil() != null) { throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm)); oalarm.repeatExpr = compileExpr(onAlarm.getRepeatEvery()); oalarm.activity = compile(onAlarm.getActivity()); throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm)); } catch (CompilationException ce) { recoveredFromError(onAlarm, ce); throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm)); } catch (CompilationException ce) { recoveredFromError(onAlarm, ce);
private void compileLinks(Activity source) { /* Source Links Fixup */ for (LinkSource ls : source.getLinkSources()) compileLinkSource(ls); /* Target Links Fixup */ for (LinkTarget lt : source.getLinkTargets()) compileLinkTarget(lt); _structureStack.topActivity().joinCondition = (source.getJoinCondition() == null || source.getLinkTargets() .isEmpty()) ? null : compileJoinCondition(source.getJoinCondition()); }
oevent.debugInfo = createDebugInfo(onEvent, null); compile(oevent, onEvent, new Runnable() { public void run() { switch (_processDef.getBpelVersion()) { throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name)); } catch (CompilationException ce) { recoveredFromError(onEvent, ce); throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name)); } catch (CompilationException ce) { recoveredFromError(onEvent, ce);
switch (_processDef.getBpelVersion()) { case BPEL11: faultVar = resolveVariable(catchSrc.getFaultVariable()); if (!(faultVar.type instanceof OMessageVarType)) throw new CompilationException(__cmsgs.errMessageVariableRequired( faultVarType = resolveMessageType(catchSrc.getFaultVariableMessageType()); else if (catchSrc.getFaultVariableElementType() != null) faultVarType = resolveElementType(catchSrc.getFaultVariableElementType()); _structureStack.topScope().activity = compile(catchSrc.getActivity());
public OExpression compileExpr(Expression expression) throws CompilationException { return compileExpr(expression, null, null, new Object[1]); }
throw new IllegalArgumentException("Unnamed scope:" + src); oscope.debugInfo = createDebugInfo(src, src.toString()); compile(oscope, src, new Runnable() { public void run() { for (Variable var : src.getVariables()) {
addWsdlImport(current, imprt.getLocation(), imprt); } else if (Import.IMPORTTYPE_XMLSCHEMA10.equals(imprt.getImportType())) { addXsdImport(current, imprt.getLocation(), imprt); } else throw new CompilationException(__cmsgs.errUnknownImportType(imprt.getImportType()).setSource(imprt));
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()); } });
public OLValueExpression compileLValueExpr(Expression expression) throws CompilationException { return compileLValueExpr(expression, null, null, new Object[1]); }
private void compile(CompensationHandler compensationHandler) { OScope oscope = _structureStack.topScope(); oscope.compensationHandler = new OCompensationHandler(_oprocess, oscope); oscope.compensationHandler.name = "__compenationHandler_" + oscope.name; oscope.compensationHandler.debugInfo = createDebugInfo(compensationHandler, null); if (compensationHandler == null) { oscope.compensationHandler.activity = createDefaultCompensateActivity(compensationHandler, "Auto-generated 'compensate all' pseudo-activity for default compensation handler on " + oscope.toString()); } else { _recoveryContextStack.push(oscope); try { oscope.compensationHandler.activity = compile(compensationHandler.getActivity()); } finally { _recoveryContextStack.pop(); } } }