Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java?rev=430117&r1=430116&r2=430117&view=diff ============================================================================== --- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java (original) +++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java Wed Aug 9 11:58:06 2006 @@ -18,7 +18,18 @@ */ package org.apache.ode.bpel.compiler; -import org.apache.ode.bom.api.*; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.ode.bom.api.Activity; +import org.apache.ode.bom.api.AssignActivity; +import org.apache.ode.bom.api.Copy; +import org.apache.ode.bom.api.ExpressionVal; +import org.apache.ode.bom.api.From; +import org.apache.ode.bom.api.LiteralVal; +import org.apache.ode.bom.api.PartnerLinkVal; +import org.apache.ode.bom.api.PropertyVal; +import org.apache.ode.bom.api.To; +import org.apache.ode.bom.api.VariableVal; import org.apache.ode.bom.impl.nodes.ExpressionValImpl; import org.apache.ode.bpel.capi.CompilationException; import org.apache.ode.bpel.o.DebugInfo; @@ -27,8 +38,6 @@ import org.apache.ode.bpel.o.OMessageVarType; import org.apache.ode.utils.DOMUtils; import org.apache.ode.utils.msg.MessageBundle; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -56,7 +65,8 @@ for (Copy scopy : ad.getCopies()) { OAssign.Copy ocopy = new OAssign.Copy(_context.getOProcess()); ocopy.keepSrcElementName = scopy.isKeepSrcElement(); - ocopy.debugInfo = new DebugInfo(_context.getSourceLocation(), scopy.getLineNo()); + ocopy.debugInfo = new DebugInfo(_context.getSourceLocation(), scopy.getLineNo(), + source.getExtensibilityElements()); try { if (scopy.getFrom() == null) throw new CompilationException(__cmsgs.errMissingFromSpec().setSource(scopy));
Modified: incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java?rev=430117&r1=430116&r2=430117&view=diff ============================================================================== --- incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java (original) +++ incubator/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java Wed Aug 9 11:58:06 2006 @@ -18,24 +18,45 @@ */ package org.apache.ode.bpel.compiler; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.ode.bom.api.*; -import org.apache.ode.bom.api.Import; import org.apache.ode.bom.api.Process; -import org.apache.ode.bom.wsdl.*; -import org.apache.ode.bpel.capi.*; +import org.apache.ode.bom.wsdl.Definition4BPEL; +import org.apache.ode.bom.wsdl.PartnerLinkType; +import org.apache.ode.bom.wsdl.Property; +import org.apache.ode.bom.wsdl.PropertyAlias; +import org.apache.ode.bom.wsdl.WSDLFactory4BPEL; +import org.apache.ode.bpel.capi.CompilationException; +import org.apache.ode.bpel.capi.CompilationMessage; +import org.apache.ode.bpel.capi.CompileListener; +import org.apache.ode.bpel.capi.CompilerContext; +import org.apache.ode.bpel.capi.ExpressionCompiler; import org.apache.ode.bpel.o.*; import org.apache.ode.utils.msg.MessageBundle; import org.apache.ode.utils.stl.CollectionsX; import org.apache.ode.utils.stl.MemberOfFunction; import org.apache.ode.utils.stl.UnaryFunction; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import javax.wsdl.*; +import org.w3c.dom.Element; + +import javax.wsdl.Definition; +import javax.wsdl.Message; +import javax.wsdl.Operation; +import javax.wsdl.Part; +import javax.wsdl.PortType; +import javax.wsdl.WSDLException; import javax.wsdl.xml.WSDLReader; import javax.xml.namespace.QName; import java.net.URI; import java.net.URISyntaxException; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Stack; /** @@ -1130,11 +1151,25 @@ private DebugInfo createDebugInfo(BpelObject bpelObject, String description) { int lineNo = bpelObject == null ? -1 : bpelObject.getLineNo(); String str = description == null && bpelObject != null ? bpelObject.toString() : null; - DebugInfo debugInfo = new DebugInfo(_processDef.getSource(), lineNo); + Map<QName, Element> extElmt = null; + if (bpelObject instanceof Activity) { + extElmt = ((Activity)bpelObject).getExtensibilityElements(); + if (extElmt.size() == 0) extElmt = checkRDFHierarchy(); + } + DebugInfo debugInfo = new DebugInfo(_processDef.getSource(), lineNo, extElmt); debugInfo.description = str; return debugInfo; } + private HashMap<QName, Element> checkRDFHierarchy() { + // RDF extensibility elements should be "inherited". + for (OActivity oActivity : _compiledActivities) { + if (oActivity.debugInfo.extensibilityElements.size() > 0) { + return oActivity.debugInfo.extensibilityElements; + } + } + return null; + } private void compile(final Variable src) { final OScope oscope = _structureStack.topScope(); Modified: incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/DebugInfo.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/DebugInfo.java?rev=430117&r1=430116&r2=430117&view=diff ============================================================================== --- incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/DebugInfo.java (original) +++ incubator/ode/trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/DebugInfo.java Wed Aug 9 11:58:06 2006 @@ -18,7 +18,12 @@ */ package org.apache.ode.bpel.o; +import org.w3c.dom.Element; + +import javax.xml.namespace.QName; import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; /** * Information about the source that was used to create a compiled object. @@ -37,14 +42,19 @@ public String description; - public DebugInfo(String sourceURI, int startLine, int endLine) { + public HashMap<QName, Element> extensibilityElements = new HashMap<QName, Element>(); + + public DebugInfo(String sourceURI, int startLine, int endLine, Map<QName, Element> extElmt) { this.sourceURI = sourceURI; this.startLine = startLine; this.endLine = endLine; + if (extElmt != null && extElmt.size() > 0) { + this.extensibilityElements = new HashMap<QName, Element>(extElmt); + } } - public DebugInfo(String sourceURI, int line) { - this(sourceURI, line, line); + public DebugInfo(String sourceURI, int line, Map<QName, Element> extElmt) { + this(sourceURI, line, line, extElmt); } } Modified: incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/BpelBaseActivityState.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/BpelBaseActivityState.java?rev=430117&r1=430116&r2=430117&view=diff ============================================================================== --- incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/BpelBaseActivityState.java (original) +++ incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/BpelBaseActivityState.java Wed Aug 9 11:58:06 2006 @@ -21,11 +21,11 @@ import org.apache.ode.bom.api.Activity; import org.apache.ode.bom.api.LinkSource; import org.apache.ode.bom.api.LinkTarget; +import org.apache.ode.sax.evt.StartElement; +import org.apache.ode.sax.evt.XmlAttributes; import org.apache.ode.sax.fsa.ParseContext; import org.apache.ode.sax.fsa.ParseException; import org.apache.ode.sax.fsa.State; -import org.apache.ode.sax.evt.StartElement; -import org.apache.ode.sax.evt.XmlAttributes; import java.util.Iterator; @@ -71,6 +71,10 @@ case BPEL_SOURCES: for(Iterator<LinkSource> iter = ((BpelLinkSourcesState)pn).getSources(); iter.hasNext(); ) _activity.addSource(iter.next()); + break; + case EXTENSIBILITY_ELEMENT: + ExtensibilityBucketState ebs = ((ExtensibilityBucketState)pn); + _activity.getExtensibilityElements().put(ebs.getElementQName(), ebs.getExtensibility()); break; default: super.handleChildCompleted(pn); Modified: incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/ExtensibilityBucketState.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/ExtensibilityBucketState.java?rev=430117&r1=430116&r2=430117&view=diff ============================================================================== --- incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/ExtensibilityBucketState.java (original) +++ incubator/ode/trunk/bpel-parser/src/main/java/org/apache/ode/sax/fsa/bpel_2_0/ExtensibilityBucketState.java Wed Aug 9 11:58:06 2006 @@ -18,52 +18,80 @@ */ package org.apache.ode.sax.fsa.bpel_2_0; +import org.apache.ode.sax.evt.SaxEvent; +import org.apache.ode.sax.evt.StartElement; import org.apache.ode.sax.fsa.AbstractState; +import org.apache.ode.sax.fsa.DOMGenerator; import org.apache.ode.sax.fsa.ParseContext; import org.apache.ode.sax.fsa.ParseException; import org.apache.ode.sax.fsa.State; import org.apache.ode.sax.fsa.StateFactory; -import org.apache.ode.sax.evt.SaxEvent; -import org.apache.ode.sax.evt.StartElement; +import org.apache.ode.utils.DOMUtils; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import javax.xml.namespace.QName; /** * Bucket state to capture schema-level extensibility elements. Extensibility * attributes must be handled elsewhere. */ -class ExtensibilityBucketState - extends AbstractState -{ +class ExtensibilityBucketState extends AbstractState { - private static final StateFactory _factory = new Factory(); + private static final StateFactory _factory = new Factory(); - ExtensibilityBucketState(StartElement se, ParseContext pc) { - super(pc); + private QName _elementQName; + private Element _extensibility; + private DOMGenerator _domGenerator; + + ExtensibilityBucketState(StartElement se, ParseContext pc) { + super(pc); + _elementQName = se.getName(); + _domGenerator = new DOMGenerator(); + } + + static class Factory implements StateFactory + { + public State newInstance(StartElement se, ParseContext pc) + throws ParseException { + return new ExtensibilityBucketState(se, pc); } + } - static class Factory implements StateFactory - { - public State newInstance(StartElement se, ParseContext pc) - throws ParseException { - return new ExtensibilityBucketState(se, pc); - } - } + public void handleSaxEvent(SaxEvent se) throws ParseException { + /* + * For the moment, this is a basic implementation, but if supporting + * extensions is desired, those extensions can be hooked from here. + * Ideally, we'd have some kind of registry implementation that routes + * SaxEvent streams based on URI or some other scheme. However, for the + * moment, we don't have any use cases. WS-BPEL 2.0 extensibility can be + * implemented according to the spec, once that's settled. + */ + _domGenerator.handleSaxEvent(se); + } + + public void done() { + Document doc = DOMUtils.newDocument(); + Element root = doc.createElementNS(_elementQName.getNamespaceURI(), _elementQName.getLocalPart()); + root.appendChild(doc.importNode(_domGenerator.getRoot(), true)); + doc.appendChild(root); + _extensibility = root; + } + + public StateFactory getFactory() { + return _factory; + } + + public int getType() { + return EXTENSIBILITY_ELEMENT; + } + + public QName getElementQName() { + return _elementQName; + } + + public Element getExtensibility() { + return _extensibility; + } - public void handleSaxEvent(SaxEvent se) throws ParseException { - /* - * For the moment, this is a no-op implementation, but if supporting - * extensions is desired, those extensions can be hooked from here. - * Ideally, we'd have some kind of registry implementation that routes - * SaxEvent streams based on URI or some other scheme. However, for the - * moment, we don't have any use cases. WS-BPEL 2.0 extensibility can be - * implemented according to the spec, once that's settled. - */ - } - - public StateFactory getFactory() { - return _factory; - } - - public int getType() { - return EXTENSIBILITY_ELEMENT; - } } Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java?rev=430117&r1=430116&r2=430117&view=diff ============================================================================== --- incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java (original) +++ incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java Wed Aug 9 11:58:06 2006 @@ -29,9 +29,9 @@ import org.apache.ode.bpel.iapi.EndpointReference; import org.apache.ode.bpel.iapi.Message; import org.apache.ode.bpel.iapi.MessageExchange; -import org.apache.ode.bpel.iapi.MessageExchangeInterceptor; import org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern; import org.apache.ode.bpel.iapi.MessageExchange.Status; +import org.apache.ode.bpel.iapi.MessageExchangeInterceptor; import org.apache.ode.bpel.iapi.MyRoleMessageExchange; import org.apache.ode.bpel.iapi.MyRoleMessageExchange.CorrelationStatus; import org.apache.ode.bpel.o.OPartnerLink; @@ -232,8 +232,7 @@ OProcess getOProcess(QName processId) { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("todo"); + return _activeProcesses.get(processId)._oprocess; } public void onScheduledJob(String jobId, Map<String, Object> jobDetail) { Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java?rev=430117&r1=430116&r2=430117&view=diff ============================================================================== --- incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java (original) +++ incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java Wed Aug 9 11:58:06 2006 @@ -19,10 +19,23 @@ package org.apache.ode.bpel.engine; -import org.apache.ode.bpel.common.*; -import org.apache.ode.bpel.dao.*; +import org.apache.commons.collections.map.MultiKeyMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.ode.bpel.common.BpelEventFilter; +import org.apache.ode.bpel.common.InstanceFilter; +import org.apache.ode.bpel.common.ProcessFilter; +import org.apache.ode.bpel.dao.BpelDAOConnection; +import org.apache.ode.bpel.dao.CorrelationSetDAO; +import org.apache.ode.bpel.dao.PartnerLinkDAO; +import org.apache.ode.bpel.dao.ProcessDAO; +import org.apache.ode.bpel.dao.ProcessInstanceDAO; +import org.apache.ode.bpel.dao.ProcessPropertyDAO; +import org.apache.ode.bpel.dao.ScopeDAO; +import org.apache.ode.bpel.dao.XmlDataDAO; import org.apache.ode.bpel.evt.BpelEvent; import org.apache.ode.bpel.evtproc.ActivityStateDocumentBuilder; +import org.apache.ode.bpel.o.OBase; import org.apache.ode.bpel.o.OPartnerLink; import org.apache.ode.bpel.o.OProcess; import org.apache.ode.bpel.pmapi.*; @@ -31,9 +44,6 @@ import org.apache.ode.utils.msg.MessageBundle; import org.apache.ode.utils.stl.CollectionsX; import org.apache.ode.utils.stl.UnaryFunction; -import org.apache.commons.collections.map.MultiKeyMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -42,7 +52,13 @@ import javax.xml.namespace.QName; import java.io.File; import java.io.IOException; -import java.util.*; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; /** * Implentation of the Process and InstanceManagement APIs. @@ -67,7 +83,7 @@ } - public ProcessInfoListDocument listProcesses(String filter, String orderKeys, final ProcessInfoCustomizer custom) { + public ProcessInfoListDocument listProcessesCustom(String filter, String orderKeys, final ProcessInfoCustomizer custom) { ProcessInfoListDocument ret = ProcessInfoListDocument.Factory.newInstance(); final TProcessInfoList procInfoList = ret.addNewProcessInfoList(); final ProcessFilter processFilter = new ProcessFilter(filter, orderKeys); @@ -91,11 +107,11 @@ } public ProcessInfoListDocument listProcesses(String filter, String orderKeys) { - return listProcesses(filter, orderKeys, ProcessInfoCustomizer.ALL); + return listProcessesCustom(filter, orderKeys, ProcessInfoCustomizer.ALL); } - public ProcessInfoListDocument listProcesses() { - return listProcesses(null, null, ProcessInfoCustomizer.ALL); + public ProcessInfoListDocument listAllProcesses() { + return listProcessesCustom(null, null, ProcessInfoCustomizer.ALL); } public ProcessInfoDocument getProcessInfo(QName pid, ProcessInfoCustomizer custom) { @@ -136,7 +152,7 @@ return genProcessInfoDocument(pid, ProcessInfoCustomizer.NONE); } - public ProcessInfoDocument setProcessProperty(final QName pid, final QName propertyName, final Node value) + public ProcessInfoDocument setProcessPropertyNode(final QName pid, final QName propertyName, final Node value) throws ManagementException { ProcessInfoDocument ret = ProcessInfoDocument.Factory.newInstance(); final TProcessInfo pi = ret.addNewProcessInfo(); @@ -257,11 +273,11 @@ return ret; } - public InstanceInfoListDocument listInstances() { + public InstanceInfoListDocument listAllInstances() { return listInstances(null, null, Integer.MAX_VALUE); } - public InstanceInfoListDocument listInstances(int limit) { + public InstanceInfoListDocument listAllInstancesWithLimit(int limit) { return listInstances(null, null, limit); } @@ -272,10 +288,10 @@ public ScopeInfoDocument getScopeInfo(String siid) { - return getScopeInfo(siid, false); + return getScopeInfoWithActivity(siid, false); } - public ScopeInfoDocument getScopeInfo(String siid, boolean includeActivityInfo) { + public ScopeInfoDocument getScopeInfoWithActivity(String siid, boolean includeActivityInfo) { return genScopeInfoDocument(siid, includeActivityInfo); } @@ -404,6 +420,24 @@ }); } + public ActivityExtInfoListDocument getExtensibilityElements(QName pid, int[] aids) { + ActivityExtInfoListDocument aeild = ActivityExtInfoListDocument.Factory.newInstance(); + TActivitytExtInfoList taeil = aeild.addNewActivityExtInfoList(); + OProcess oprocess = _engine.getOProcess(pid); + + for (int aid : aids) { + OBase obase = oprocess.getChild(aid); + if (obase.debugInfo.extensibilityElements != null) { + for (Map.Entry<QName, Element> entry : obase.debugInfo.extensibilityElements.entrySet()) { + TActivityExtInfo taei = taeil.addNewActivityExtInfo(); + taei.setAiid(""+aid); + taei.getDomNode().appendChild(taei.getDomNode().getOwnerDocument().importNode(entry.getValue(), true)); + } + } + } + return aeild; + } + /** * Get the [EMAIL PROTECTED] DebuggerSupport} object for the given process identifier. Debugger * support is required for operations that resume execution in some way or manipulate @@ -858,9 +892,9 @@ /** - * @see org.apache.ode.bpel.pmapi.InstanceManagement#listInstances(java.lang.String) + * @see org.apache.ode.bpel.pmapi.InstanceManagement#queryInstances(java.lang.String) */ - public InstanceInfoListDocument listInstances(final String query) { + public InstanceInfoListDocument queryInstances(final String query) { InstanceInfoListDocument ret = InstanceInfoListDocument.Factory.newInstance(); final TInstanceInfoList infolist = ret.addNewInstanceInfoList();
