riftsaw SVN: r1322 - trunk/console/integration/src/main/java/org/jboss/soa/bpel/console.
by riftsaw-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2011-03-21 01:29:45 -0400 (Mon, 21 Mar 2011)
New Revision: 1322
Modified:
trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ModelAdaptor.java
trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java
Log:
*RIFTSAW-259, update the restful web service.
Modified: trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ModelAdaptor.java
===================================================================
--- trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ModelAdaptor.java 2011-03-17 08:23:42 UTC (rev 1321)
+++ trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ModelAdaptor.java 2011-03-21 05:29:45 UTC (rev 1322)
@@ -21,16 +21,21 @@
*/
package org.jboss.soa.bpel.console;
-import org.apache.ode.bpel.pmapi.*;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.pmapi.InstanceInfoListDocument;
+import org.apache.ode.bpel.pmapi.ProcessInfoListDocument;
+import org.apache.ode.bpel.pmapi.TInstanceInfo;
+import org.apache.ode.bpel.pmapi.TProcessInfo;
+import org.apache.ode.bpel.pmapi.TProcessStatus;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.soa.bpel.console.util.Base64;
-import javax.xml.namespace.QName;
-import java.util.ArrayList;
-import java.util.List;
-import java.io.IOException;
-
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -97,8 +102,9 @@
}
catch (IOException e)
{
- throw new RuntimeException("Failed to encode id", e);
+ throw new RuntimeException("Failed to decode id", e);
}
}
+
}
Modified: trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java
===================================================================
--- trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java 2011-03-17 08:23:42 UTC (rev 1321)
+++ trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java 2011-03-21 05:29:45 UTC (rev 1322)
@@ -3,11 +3,13 @@
*/
package org.jboss.soa.bpel.console;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Date;
-import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
-import java.util.Map;
+import java.util.Set;
import javax.naming.InitialContext;
import javax.naming.NamingException;
@@ -53,30 +55,64 @@
String definitionkey, String status, long starttime, long endtime,
String correlationkey) {
- List<Event> events = ds.getInstanceEvents(definitionkey, new Timespan(starttime, endtime, "Custom"), getStatus(status));
+ String dkey = null;
+ try {
+ dkey = URLDecoder.decode(definitionkey, "UTF-8");
+ } catch (UnsupportedEncodingException e1) {
+ throw new IllegalStateException("Decode definition key of " + definitionkey + " failed.");
+ }
+ List<Event> events = ds.getInstanceEvents(dkey, new Timespan(starttime, endtime, "Custom"), getStatus(status));
List<String> instanceIds = null;
- if (correlationkey != null ) {
- instanceIds = ds.getProcessInstances(definitionkey, "correlation-key", correlationkey);
+ if (correlationkey != null && !("".equals(correlationkey.trim()))) {
+ String ckey = null;
+ try {
+ ckey = URLDecoder.decode(correlationkey.replace("~", "="), "UTF-8");
+ } catch (UnsupportedEncodingException e1) {
+ throw new IllegalStateException("Decode correlation key of " + correlationkey + " failed.");
+ }
+ instanceIds = ds.getProcessInstances(dkey, "correlation-key", ckey);
}
- Map<String, HistoryProcessInstanceRef> hisInstances = new HashMap<String, HistoryProcessInstanceRef>();
+ Set<String> historyInstanceIds = new HashSet<String>();
for(Event e : events)
{
if(instanceIds == null || instanceIds.contains(e.getProcessInstanceID())) {
if (e.getEventDetails().getCurrentState().equals(getStatus(status))) {
- HistoryProcessInstanceRef hi = createHistoryInstance(status, hisInstances, e);
- hisInstances.put(e.getProcessInstanceID(), hi);
+ historyInstanceIds.add(e.getProcessInstanceID());
}
}
}
- List<HistoryProcessInstanceRef> ref = new ArrayList<HistoryProcessInstanceRef>();
- for (HistoryProcessInstanceRef hp : hisInstances.values()) {
- ref.add(hp);
+ List<HistoryProcessInstanceRef> refs = new ArrayList<HistoryProcessInstanceRef>();
+ int i = 0;
+ for (String theInstanceID : historyInstanceIds) {
+ if (i > 10) {
+ //due to performance concern, we've just listed 10 history instances at most.
+ break;
+ }
+ List<Event> theEvents = ds.getPastActivities(theInstanceID);
+ HistoryProcessInstanceRef ref = new HistoryProcessInstanceRef();
+ for (Event e : theEvents) {
+ ref.setProcessInstanceId(e.getProcessInstanceID());
+ ref.setState(status);
+ for (Tuple tuple : e.getDataElement()) {
+ if ("correlation-key".equals(tuple.getName())) {
+ ref.setKey(tuple.getValue());
+ }
+ if ("process-start-time".equals(tuple.getName())) {
+ ref.setStartTime(new Date(new Long(tuple.getValue())));
+ }
+ if ("process-end-time".equals(tuple.getName())) {
+ ref.setEndTime(new Date(new Long(tuple.getValue())));
+ }
+ }
+ }
+ refs.add(ref);
+ i++;
}
- return ref;
+ return refs;
}
private State getStatus(String status) {
@@ -91,30 +127,5 @@
}
return null;
}
-
-
-
- private HistoryProcessInstanceRef createHistoryInstance(String status, Map<String, HistoryProcessInstanceRef> hisInstances, Event e) {
- HistoryProcessInstanceRef hi = null;
- if (!hisInstances.containsKey(e.getProcessInstanceID())) {
- hi = new HistoryProcessInstanceRef();
- } else {
- hi = hisInstances.get(e.getProcessInstanceID());
- }
- hi.setProcessDefinitionId(e.getProcessInstanceID());
- hi.setState(status);
- for (Tuple tuple : e.getDataElement()) {
- if ("correlation-key".equals(tuple.getName())) {
- hi.setKey(tuple.getValue());
- }
- if ("process-start-time".equals(tuple.getName())) {
- hi.setStartTime(new Date(new Long(tuple.getValue())));
- }
- if ("process-end-time".equals(tuple.getName())) {
- hi.setEndTime(new Date(new Long(tuple.getValue())));
- }
- }
- return hi;
- }
}
13 years, 9 months
riftsaw SVN: r1321 - in trunk/console: integration and 2 other directories.
by riftsaw-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2011-03-17 04:23:42 -0400 (Thu, 17 Mar 2011)
New Revision: 1321
Added:
trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java
trunk/console/integration/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessHistoryPlugin
Modified:
trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceEndAdapter.java
trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceStartAdapter.java
trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceTerminationAdapter.java
trunk/console/integration/pom.xml
Log:
*RIFTSAW-259, added BPAFService and ProcessHistoryPluginImpl.
Modified: trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceEndAdapter.java
===================================================================
--- trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceEndAdapter.java 2011-03-16 14:08:17 UTC (rev 1320)
+++ trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceEndAdapter.java 2011-03-17 08:23:42 UTC (rev 1321)
@@ -18,6 +18,7 @@
import org.apache.ode.bpel.evt.ProcessCompletionEvent;
import org.jboss.bpm.monitor.model.bpaf.Event;
import org.jboss.bpm.monitor.model.bpaf.State;
+import org.jboss.bpm.monitor.model.bpaf.Tuple;
/**
* @author: Heiko Braun <hbraun(a)redhat.com>
@@ -37,6 +38,12 @@
InstanceStartAdapter.mapDefault(target, source);
+ Tuple endTime = new Tuple();
+ endTime.setName("process-end-time");
+ endTime.setValue(String.valueOf(source.getTimestamp().getTime()));
+
+ target.addData(endTime);
+
return target;
}
}
Modified: trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceStartAdapter.java
===================================================================
--- trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceStartAdapter.java 2011-03-16 14:08:17 UTC (rev 1320)
+++ trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceStartAdapter.java 2011-03-17 08:23:42 UTC (rev 1321)
@@ -19,6 +19,7 @@
import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
import org.jboss.bpm.monitor.model.bpaf.Event;
import org.jboss.bpm.monitor.model.bpaf.State;
+import org.jboss.bpm.monitor.model.bpaf.Tuple;
/**
* @author: Heiko Braun <hbraun(a)redhat.com>
@@ -26,14 +27,22 @@
*/
public final class InstanceStartAdapter
implements EventAdapter.EventDetailMapping<ProcessInstanceStartedEvent> {
-
+
+
+
public Event adoptDetails(Event target, ProcessInstanceStartedEvent source) {
Event.EventDetails details = target.getEventDetails();
details.setCurrentState(State.Open_Running);
mapDefault(target, source);
-
+
+ Tuple startTime = new Tuple();
+ startTime.setName("process-start-time");
+ startTime.setValue(String.valueOf(source.getTimestamp().getTime()));
+
+ target.addData(startTime);
+
return target;
}
Modified: trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceTerminationAdapter.java
===================================================================
--- trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceTerminationAdapter.java 2011-03-16 14:08:17 UTC (rev 1320)
+++ trunk/console/bpaf/src/main/java/org/jboss/soa/bpel/console/bpaf/InstanceTerminationAdapter.java 2011-03-17 08:23:42 UTC (rev 1321)
@@ -18,6 +18,7 @@
import org.apache.ode.bpel.evt.ProcessTerminationEvent;
import org.jboss.bpm.monitor.model.bpaf.Event;
import org.jboss.bpm.monitor.model.bpaf.State;
+import org.jboss.bpm.monitor.model.bpaf.Tuple;
/**
* @author: Heiko Braun <hbraun(a)redhat.com>
@@ -30,7 +31,13 @@
details.setCurrentState(State.Closed_Cancelled_Terminated);
InstanceStartAdapter.mapDefault(target, source);
-
+
+ Tuple endTime = new Tuple();
+ endTime.setName("process-end-time");
+ endTime.setValue(String.valueOf(source.getTimestamp().getTime()));
+
+ target.addData(endTime);
+
return target;
}
}
Modified: trunk/console/integration/pom.xml
===================================================================
--- trunk/console/integration/pom.xml 2011-03-16 14:08:17 UTC (rev 1320)
+++ trunk/console/integration/pom.xml 2011-03-17 08:23:42 UTC (rev 1321)
@@ -152,6 +152,12 @@
<artifactId>commons-logging</artifactId>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>activity-monitor-model</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
Added: trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java
===================================================================
--- trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java (rev 0)
+++ trunk/console/integration/src/main/java/org/jboss/soa/bpel/console/ProcessHistoryPluginImpl.java 2011-03-17 08:23:42 UTC (rev 1321)
@@ -0,0 +1,120 @@
+/**
+ *
+ */
+package org.jboss.soa.bpel.console;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.persistence.EntityManagerFactory;
+
+import org.jboss.bpm.console.client.model.HistoryProcessInstanceRef;
+import org.jboss.bpm.console.server.plugin.ProcessHistoryPlugin;
+import org.jboss.bpm.monitor.model.BPAFDataSource;
+import org.jboss.bpm.monitor.model.DefaultBPAFDataSource;
+import org.jboss.bpm.monitor.model.bpaf.Event;
+import org.jboss.bpm.monitor.model.bpaf.State;
+import org.jboss.bpm.monitor.model.bpaf.Tuple;
+import org.jboss.bpm.monitor.model.metric.Timespan;
+
+/**
+ * @author Jeff Yu
+ * @date: Mar 17, 2011
+ */
+public class ProcessHistoryPluginImpl implements ProcessHistoryPlugin {
+
+ private BPAFDataSource ds = null;
+
+ public ProcessHistoryPluginImpl() {
+ try
+ {
+ InitialContext ctx = new InitialContext();
+ EntityManagerFactory emf = (EntityManagerFactory)ctx.lookup("bpel/EntityManagerFactory");
+ if (null == emf) {
+ throw new IllegalStateException("EntityManagerFactory is null");
+ }
+ ds = new DefaultBPAFDataSource(emf);
+ }
+ catch (NamingException e)
+ {
+ throw new RuntimeException("Failed to initialize BPAF datasource");
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.bpm.console.server.plugin.ProcessHistoryPlugin#getHistoryProcessInstances(java.lang.String, java.lang.String, long, long, java.lang.String)
+ */
+ public List<HistoryProcessInstanceRef> getHistoryProcessInstances(
+ String definitionkey, String status, long starttime, long endtime,
+ String correlationkey) {
+
+ List<Event> events = ds.getInstanceEvents(definitionkey, new Timespan(starttime, endtime, "Custom"), getStatus(status));
+ List<String> instanceIds = null;
+ if (correlationkey != null ) {
+ instanceIds = ds.getProcessInstances(definitionkey, "correlation-key", correlationkey);
+ }
+
+ Map<String, HistoryProcessInstanceRef> hisInstances = new HashMap<String, HistoryProcessInstanceRef>();
+
+ for(Event e : events)
+ {
+ if(instanceIds == null || instanceIds.contains(e.getProcessInstanceID())) {
+ if (e.getEventDetails().getCurrentState().equals(getStatus(status))) {
+ HistoryProcessInstanceRef hi = createHistoryInstance(status, hisInstances, e);
+ hisInstances.put(e.getProcessInstanceID(), hi);
+ }
+ }
+ }
+
+ List<HistoryProcessInstanceRef> ref = new ArrayList<HistoryProcessInstanceRef>();
+ for (HistoryProcessInstanceRef hp : hisInstances.values()) {
+ ref.add(hp);
+ }
+
+ return ref;
+ }
+
+ private State getStatus(String status) {
+ if ("COMPLETED".equalsIgnoreCase(status)) {
+ return State.Closed_Completed;
+ }
+ if ("FAILED".equalsIgnoreCase(status)) {
+ return State.Closed_Completed_Failed;
+ }
+ if ("TERMINATED".equalsIgnoreCase(status)) {
+ return State.Closed_Cancelled_Terminated;
+ }
+ return null;
+ }
+
+
+
+ private HistoryProcessInstanceRef createHistoryInstance(String status, Map<String, HistoryProcessInstanceRef> hisInstances, Event e) {
+ HistoryProcessInstanceRef hi = null;
+ if (!hisInstances.containsKey(e.getProcessInstanceID())) {
+ hi = new HistoryProcessInstanceRef();
+ } else {
+ hi = hisInstances.get(e.getProcessInstanceID());
+ }
+ hi.setProcessDefinitionId(e.getProcessInstanceID());
+ hi.setState(status);
+ for (Tuple tuple : e.getDataElement()) {
+ if ("correlation-key".equals(tuple.getName())) {
+ hi.setKey(tuple.getValue());
+ }
+ if ("process-start-time".equals(tuple.getName())) {
+ hi.setStartTime(new Date(new Long(tuple.getValue())));
+ }
+ if ("process-end-time".equals(tuple.getName())) {
+ hi.setEndTime(new Date(new Long(tuple.getValue())));
+ }
+ }
+ return hi;
+ }
+
+}
Added: trunk/console/integration/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessHistoryPlugin
===================================================================
--- trunk/console/integration/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessHistoryPlugin (rev 0)
+++ trunk/console/integration/src/main/resources/META-INF/services/org.jboss.bpm.console.server.plugin.ProcessHistoryPlugin 2011-03-17 08:23:42 UTC (rev 1321)
@@ -0,0 +1 @@
+org.jboss.soa.bpel.console.ProcessHistoryPluginImpl
\ No newline at end of file
13 years, 9 months
riftsaw SVN: r1320 - branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-03-16 10:08:17 -0400 (Wed, 16 Mar 2011)
New Revision: 1320
Modified:
branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
Log:
ODE-915/RIFTSAW-318: Had to revert the order change of variable/partner link compilation, as this appears to introduce a class cast exception when deserializing an older process instance. This however may mean that variable initialization based on a partner link will not work, but this type of initialization is less likely, so better to atleast have the mechanism in some form of working order.
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java 2011-03-15 14:56:00 UTC (rev 1319)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java 2011-03-16 14:08:17 UTC (rev 1320)
@@ -1171,6 +1171,14 @@
try {
compile(oscope, src, new Runnable() {
public void run() {
+ for (Variable var : src.getVariables()) {
+ try {
+ compile(var);
+ } catch (CompilationException ce) {
+ recoveredFromError(var, ce);
+ }
+ }
+
for (CorrelationSet cset : src.getCorrelationSetDecls()) {
try {
compile(cset);
@@ -1187,15 +1195,6 @@
}
}
- // Changed order in case variable initialization based on partner link
- for (Variable var : src.getVariables()) {
- try {
- compile(var);
- } catch (CompilationException ce) {
- recoveredFromError(var, ce);
- }
- }
-
if (!src.getEvents().isEmpty() || !src.getAlarms().isEmpty()) {
oscope.eventHandler = new OEventHandler(_oprocess);
oscope.eventHandler.debugInfo = createDebugInfo(src, "Event Handler for " + src);
13 years, 9 months
riftsaw SVN: r1319 - in branches/ODE/RiftSaw-ODE-trunk: bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom and 2 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-03-15 10:56:00 -0400 (Tue, 15 Mar 2011)
New Revision: 1319
Modified:
branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java
branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java
branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
Log:
Bring riftsaw-ode trunk upto date with changes in ODE-915 patch.
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java 2011-03-03 10:53:41 UTC (rev 1318)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java 2011-03-15 14:56:00 UTC (rev 1319)
@@ -45,8 +45,8 @@
import javax.xml.namespace.QName;
/**
- * Generates code for <code><assign></code> activities.
- *
+ * Generates code for <code><assign></code> activities.
+ *
* @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
*/
class AssignGenerator extends DefaultActivityGenerator {
@@ -80,7 +80,7 @@
if (scopy.getFrom() == null)
throw new CompilationException(__cmsgs.errMissingFromSpec().setSource(scopy));
ocopy.from = compileFrom(scopy.getFrom(), toResultType[0]);
-
+
verifyCopy(ocopy);
oassign.copy.add(ocopy);
@@ -92,7 +92,7 @@
/**
* Verify that a copy follows the correct form.
- *
+ *
* @param ocopy
*/
private void verifyCopy(OAssign.Copy ocopy) {
@@ -204,9 +204,9 @@
}
/**
- * Compile an extension to/from-spec. Extension to/from-specs are compiled into
- * "DirectRef"s.
- *
+ * Compile an extension to/from-spec. Extension to/from-specs are compiled into
+ * "DirectRef"s.
+ *
* @param extVal source representation
* @return compiled representation
*/
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java 2011-03-03 10:53:41 UTC (rev 1318)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/Variable.java 2011-03-15 14:56:00 UTC (rev 1319)
@@ -37,7 +37,7 @@
/**
* Get the name of the variable.
- *
+ *
* @return variable name
*/
public String getName() {
@@ -46,7 +46,7 @@
/**
* Get the type name of this variable.
- *
+ *
* @return an XML element, XML schema type, or WSDL message type name.
*/
public QName getTypeName() {
@@ -72,7 +72,7 @@
/**
* Get the type of declaration; one of: {@link #TYPE_SCHEMA},
* {@link #TYPE_ELEMENT}, or {@link #TYPE_MESSAGE}.
- *
+ *
* @return type of variable decleration
*/
public Kind getKind() {
@@ -90,7 +90,7 @@
//
// Stuff related to external variables.
//
-
+
/**
* Get the external variable identifier (each one will be defined in the deployment descriptor)
*/
@@ -105,15 +105,15 @@
public boolean isExternal() {
return null != getExternalId();
}
-
+
/**
* External variable support - get the "related" variable name.
* @return
*/
public String getRelated() {
- return getAttribute(ExtensibilityQNames.EXTVAR_RELATED, null);
+ return getAttribute(ExtensibilityQNames.EXTVAR_RELATED, null);
}
-
+
/**
* Get the 'from' specification.
*
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java 2011-03-03 10:53:41 UTC (rev 1318)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java 2011-03-15 14:56:00 UTC (rev 1319)
@@ -22,7 +22,6 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -32,7 +31,7 @@
* are generated by the BPEL compiler.
*/
public class OScope extends OActivity {
-
+
static final long serialVersionUID = -1L ;
/** Name of the scope. */
@@ -46,7 +45,7 @@
/** ScopeLikeConstructImpl's compensation handler. */
public OCompensationHandler compensationHandler;
-
+
/** ScopeLikeConstructImpl's termination handler. */
public OTerminationHandler terminationHandler;
@@ -54,12 +53,7 @@
public OEventHandler eventHandler;
/** Variables declared within the scope. */
- /* madars.vitolins _at gmail.com 2009.04.11 Inline variable initialization
- * We need LinkedHashMap because order of variables are significant!
- * So that next variable can be initialized from previous (if previous is inline initialized)
- * LinkedHashMap acts like HashMap but it keeps the order
- */
- public final LinkedHashMap<String,Variable> variables = new LinkedHashMap<String,Variable>();
+ public final HashMap<String,Variable> variables = new HashMap<String,Variable>();
/** OCorrelation sets declared within the scope. */
public final Map<String,CorrelationSet> correlationSets = new HashMap<String, CorrelationSet>();
@@ -71,8 +65,11 @@
public boolean implicitScope;
+ /** Is this scope <em>atomic</em> i.e. meant to execute in a single transaction. */
public boolean atomicScope;
+ public final List<Variable> variableList = new ArrayList<Variable>();
+
public OScope(OProcess owner, OActivity parent) {
super(owner, parent);
}
@@ -101,6 +98,7 @@
public void addLocalVariable(Variable variable) {
variables.put(variable.name, variable);
+ variableList.add(variable);
}
public Variable getVisibleVariable(String varName) {
@@ -155,11 +153,11 @@
public static final class CorrelationSet extends OBase {
static final long serialVersionUID = -1L ;
-
+
public String name;
public OScope declaringScope;
public final List<OProcess.OProperty>properties = new ArrayList<OProcess.OProperty>();
-
+
/**
* Indicates that this correlation set has a join use case in the scope.
*/
@@ -204,35 +202,38 @@
return buf.toString();
}
}
-
+
@Override
public void dehydrate() {
- super.dehydrate();
- this.activity = null;
- if (compensatable != null) {
- compensatable.clear();
- }
- if (compensationHandler != null) {
- compensationHandler.dehydrate();
- compensationHandler = null;
- }
- if (terminationHandler != null) {
- terminationHandler.dehydrate();
- terminationHandler = null;
- }
- if (eventHandler != null) {
- eventHandler.dehydrate();
- eventHandler = null;
- }
- if (variables != null) {
- variables.clear();
- }
- if (correlationSets != null) {
- correlationSets.clear();
- }
- if (partnerLinks != null) {
- partnerLinks.clear();
- }
+ super.dehydrate();
+ this.activity = null;
+ if (compensatable != null) {
+ compensatable.clear();
+ }
+ if (compensationHandler != null) {
+ compensationHandler.dehydrate();
+ compensationHandler = null;
+ }
+ if (terminationHandler != null) {
+ terminationHandler.dehydrate();
+ terminationHandler = null;
+ }
+ if (eventHandler != null) {
+ eventHandler.dehydrate();
+ eventHandler = null;
+ }
+ if (variables != null) {
+ variables.clear();
+ }
+ if (variableList != null) {
+ variableList.clear();
+ }
+ if (correlationSets != null) {
+ correlationSets.clear();
+ }
+ if (partnerLinks != null) {
+ partnerLinks.clear();
+ }
}
}
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java 2011-03-03 10:53:41 UTC (rev 1318)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java 2011-03-15 14:56:00 UTC (rev 1319)
@@ -126,4 +126,5 @@
private OAssign getOAsssign() {
return (OAssign) _self.o;
}
+
}
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java 2011-03-03 10:53:41 UTC (rev 1318)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/AssignHelper.java 2011-03-15 14:56:00 UTC (rev 1319)
@@ -141,6 +141,42 @@
}
}// initVar()
+ /**
+ * Assumes that variable is variable not kind of partner links.
+ *
+ * @param var
+ * @return
+ * @throws FaultException
+ * @throws ExternalVariableModuleException
+ * @author madars.vitolins _at gmail.com
+ */
+ public Node evalLValue(Variable var) throws FaultException,
+ ExternalVariableModuleException {
+ final BpelRuntimeContext napi = getBpelRuntimeContext();
+ Node lval = null;
+ VariableInstance lvar = _scopeFrame.resolve(var);
+ if (!napi.isVariableInitialized(lvar)) {
+ Document doc = DOMUtils.newDocument();
+ Node val = var.type.newInstance(doc);
+ if (val.getNodeType() == Node.TEXT_NODE) {
+ Element tempwrapper = doc.createElementNS(null,
+ "temporary-simple-type-wrapper");
+ doc.appendChild(tempwrapper);
+ tempwrapper.appendChild(val);
+ val = tempwrapper;
+ } else
+ doc.appendChild(val);
+ // Only external variables need to be initialized, others are new
+ // and going to be overwritten
+ if (lvar.declaration.extVar != null)
+ lval = initializeVariable(lvar, val);
+ else
+ lval = val;
+ } else
+ lval = fetchVariableData(lvar, true);
+ return lval;
+ }
+
public void run() {
String errMsg="AssignHelper cannot be ran as ACTIVITY";
__log.error(errMsg);
@@ -189,42 +225,6 @@
return lval;
}
- /**
- * Assumes that variable is variable not kind of partner links.
- *
- * @param var
- * @return
- * @throws FaultException
- * @throws ExternalVariableModuleException
- * @author madars.vitolins _at gmail.com
- */
- public Node evalLValue(Variable var) throws FaultException,
- ExternalVariableModuleException {
- final BpelRuntimeContext napi = getBpelRuntimeContext();
- Node lval = null;
- VariableInstance lvar = _scopeFrame.resolve(var);
- if (!napi.isVariableInitialized(lvar)) {
- Document doc = DOMUtils.newDocument();
- Node val = var.type.newInstance(doc);
- if (val.getNodeType() == Node.TEXT_NODE) {
- Element tempwrapper = doc.createElementNS(null,
- "temporary-simple-type-wrapper");
- doc.appendChild(tempwrapper);
- tempwrapper.appendChild(val);
- val = tempwrapper;
- } else
- doc.appendChild(val);
- // Only external variables need to be initialized, others are new
- // and going to be overwritten
- if (lvar.declaration.extVar != null)
- lval = initializeVariable(lvar, val);
- else
- lval = val;
- } else
- lval = fetchVariableData(lvar, true);
- return lval;
- }
-
/**
* Get the r-value. There are several possibilities:
* <ul>
@@ -411,7 +411,7 @@
if (__log.isDebugEnabled())
__log.debug("Assign.copy(" + ocopy + ")");
-
+
ScopeEvent se;
// Check for message to message - copy, we can do this efficiently in
@@ -534,7 +534,7 @@
throw fe;
}
}
-
+
private void replaceEndpointRefence(PartnerLinkInstance plval, Node rvalue) throws FaultException {
if (rvalue.getNodeType() == Node.ATTRIBUTE_NODE){
rvalue = rvalue.getOwnerDocument().createTextNode(((Attr) rvalue).getValue());
@@ -584,7 +584,7 @@
}
parent.replaceChild(replacement, ptr);
DOMUtils.copyNSContext(ptr, replacement);
-
+
return (lval == ptr) ? replacement : lval;
}
@@ -718,14 +718,14 @@
private Node _rootNode;
private EvaluationContext _ctx;
-
+
private EvaluationContextProxy(Variable var, Node varNode) {
_var = var;
_varNode = varNode;
_ctx = getEvaluationContext();
}
-
+
public Node readVariable(OScope.Variable variable, OMessageVarType.Part part) throws FaultException {
if (variable.name.equals(_var.name)) {
if (part == null) return _varNode;
@@ -798,7 +798,7 @@
}
public Date getCurrentEventDateTime() {
- return Calendar.getInstance().getTime();
+ return Calendar.getInstance().getTime();
}
}
Modified: branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
===================================================================
--- branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-03-03 10:53:41 UTC (rev 1318)
+++ branches/ODE/RiftSaw-ODE-trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java 2011-03-15 14:56:00 UTC (rev 1319)
@@ -62,7 +62,7 @@
*/
class SCOPE extends ACTIVITY {
private static final long serialVersionUID = 6111903798996023525L;
-
+
private static final Log __log = LogFactory.getLog(SCOPE.class);
private OScope _oscope;
@@ -98,7 +98,7 @@
private void initVars() throws FaultException,
ExternalVariableModuleException {
AssignHelper assignHelper = new AssignHelper(_self, _scopeFrame, _linkFrame);
- for (OScope.Variable var : _oscope.variables.values()) {
+ for (OScope.Variable var : _oscope.variableList) {
if (var != null && var.from != null) {
assignHelper.initVar(var);
@@ -107,7 +107,7 @@
}
public void run() {
-
+
// Start the child activity.
_child = new ActivityInfo(genMonotonic(),
_oscope.activity,
@@ -124,7 +124,7 @@
_eventHandlers.add(ehi);
instance(new EH_ALARM(ehi.psc,ehi.tc, ehi.cc, alarm, _scopeFrame));
}
-
+
for (Iterator<OEventHandler.OEvent> i = _oscope.eventHandler.onMessages.iterator(); i.hasNext(); ) {
OEventHandler.OEvent event = i.next();
EventHandlerInfo ehi = new EventHandlerInfo(event,
@@ -136,7 +136,7 @@
}
}
- getBpelRuntimeContext().initializePartnerLinks(_scopeFrame.scopeInstanceId,
+ getBpelRuntimeContext().initializePartnerLinks(_scopeFrame.scopeInstanceId,
_oscope.partnerLinks.values());
sendEvent(new ScopeStartEvent());
@@ -429,7 +429,7 @@
}
} else /* completed ok */ {
sendEvent(new ScopeCompletionEvent());
-
+
if (_oscope.compensationHandler != null) {
CompensationHandler compensationHandler = new CompensationHandler(
_scopeFrame,
@@ -519,7 +519,7 @@
bestMatch = c;
} else {
// Otherwise we prefer name and variable matches but prefer name-only matches to
- // variable-only matches.
+ // variable-only matches.
int existingScore = (bestMatch.faultName == null ? 0 : 2) + (bestMatch.faultVariable == null ? 0 : 1);
int currentScore = (c.faultName == null ? 0 : 2) + (c.faultVariable == null ? 0 : 1);
if (currentScore > existingScore) {
13 years, 9 months
riftsaw SVN: r1318 - in trunk: distribution and 2 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2011-03-03 05:53:41 -0500 (Thu, 03 Mar 2011)
New Revision: 1318
Modified:
trunk/distribution/pom.xml
trunk/pom.xml
trunk/runtime/engine-assembly/pom.xml
trunk/runtime/engine-assembly/src/main/assembly/sar.xml
Log:
RIFTSAW-352 - update saxon version to 9.2
Modified: trunk/distribution/pom.xml
===================================================================
--- trunk/distribution/pom.xml 2011-03-01 15:51:29 UTC (rev 1317)
+++ trunk/distribution/pom.xml 2011-03-03 10:53:41 UTC (rev 1318)
@@ -109,8 +109,14 @@
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</dependency>
+
<dependency>
<groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxonhe</artifactId>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
</dependency>
<dependency>
@@ -128,7 +134,8 @@
<artifactId>saxon</artifactId>
<classifier>xqj</classifier>
</dependency>
-
+ -->
+
<dependency>
<artifactId>h2</artifactId>
<groupId>com.h2database</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-03-01 15:51:29 UTC (rev 1317)
+++ trunk/pom.xml 2011-03-03 10:53:41 UTC (rev 1318)
@@ -106,7 +106,7 @@
<xerces.version>2.9.0</xerces.version>
<commons.httpclient.version>3.1</commons.httpclient.version>
<cxf.version>2.2.6</cxf.version>
- <saxon.version>9.1.0.8</saxon.version>
+ <saxon.version>9.2.1.5</saxon.version>
<spring.version>2.5.6.SEC01</spring.version> <!-- This version must match the version used by the ESB -->
<batik.version>1.7</batik.version>
<axiom.version>1.2.8</axiom.version>
@@ -356,6 +356,12 @@
<dependency>
<groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxonhe</artifactId>
+ <version>${saxon.version}</version>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
<classifier>dom</classifier>
<version>${saxon.version}</version>
@@ -377,6 +383,7 @@
<artifactId>saxon</artifactId>
<version>${saxon.version}</version>
</dependency>
+ -->
</dependencies>
</dependencyManagement>
Modified: trunk/runtime/engine-assembly/pom.xml
===================================================================
--- trunk/runtime/engine-assembly/pom.xml 2011-03-01 15:51:29 UTC (rev 1317)
+++ trunk/runtime/engine-assembly/pom.xml 2011-03-03 10:53:41 UTC (rev 1318)
@@ -100,6 +100,11 @@
<dependency>
<groupId>net.sourceforge.saxon</groupId>
+ <artifactId>saxonhe</artifactId>
+ </dependency>
+ <!--
+ <dependency>
+ <groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
</dependency>
<dependency>
@@ -117,6 +122,7 @@
<artifactId>saxon</artifactId>
<classifier>xqj</classifier>
</dependency>
+ -->
</dependencies>
Modified: trunk/runtime/engine-assembly/src/main/assembly/sar.xml
===================================================================
--- trunk/runtime/engine-assembly/src/main/assembly/sar.xml 2011-03-01 15:51:29 UTC (rev 1317)
+++ trunk/runtime/engine-assembly/src/main/assembly/sar.xml 2011-03-03 10:53:41 UTC (rev 1318)
@@ -64,10 +64,13 @@
<include>org.jboss.soa.bpel:riftsaw-scheduler-simple</include>
<include>org.jboss.soa.bpel.runtime:riftsaw-uddi</include>
<include>org.jboss.soa.bpel:riftsaw-utils</include>
+ <include>net.sourceforge.saxon:saxonhe</include>
+ <!--
<include>net.sourceforge.saxon:saxon</include>
<include>net.sourceforge.saxon:saxon:jar:xpath</include>
<include>net.sourceforge.saxon:saxon:jar:dom</include>
<include>net.sourceforge.saxon:saxon:jar:xqj</include>
+ -->
<include>org.springframework:spring</include>
<include>org.apache.xmlbeans:xmlbeans</include>
</includes>
13 years, 10 months