incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r.@apache.org
Subject svn commit: r903192 [1/2] - in /incubator/hise/trunk: hise-services/src/main/java/org/apache/hise/engine/ hise-services/src/main/java/org/apache/hise/engine/jaxws/ hise-services/src/main/java/org/apache/hise/engine/store/ hise-services/src/main/java/or...
Date Tue, 26 Jan 2010 12:14:15 GMT
Author: rr
Date: Tue Jan 26 12:14:14 2010
New Revision: 903192

URL: http://svn.apache.org/viewvc?rev=903192&view=rev
Log:
HISE-19: Implemented notifications + added integration test scenario

Modified:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngine.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HumanInteractionsCompiler.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/TaskDefinition.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/DeadlineController.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/DOMUtils.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/XQueryEvaluator.java
    incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/CompilerTest.java
    incubator/hise/trunk/hise-services/src/test/resources/testHtd1.xml
    incubator/hise/trunk/hise-test-example/src/main/resources/ExampleTasks.wsdl
    incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-hise-dd.xml
    incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1.xml
    incubator/hise/trunk/hise-web/soapui-tests/hise-soapui-project.xml
    incubator/hise/trunk/hise-web/src/test/java/org/apache/hise/SampleUsers.java

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngine.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngine.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngine.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngine.java
Tue Jan 26 12:14:14 2010
@@ -129,7 +129,13 @@
         QName taskName = getTaskName(portType, operation);
         assert(taskName != null);
         log.debug("routed " + portType + " " + operation + " -> " + taskName);
-        Task t = Task.create(this, getTaskDefinition(taskName), createdBy, DOMUtils.getFirstElement(body),
requestHeader);
+        TaskDefinition def = getTaskDefinition(taskName);
+        Task t;
+        if (def.isNotification()) {
+            t = Task.createNotification(this, getTaskDefinition(taskName), createdBy, DOMUtils.getFirstElement(body),
requestHeader);
+        } else {
+            t = Task.create(this, getTaskDefinition(taskName), createdBy, DOMUtils.getFirstElement(body),
requestHeader);
+        }
         return t.getTaskEvaluator().evaluateApproveResponseHeader();
     }
     

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/HISEJaxWSService.java
Tue Jan 26 12:14:14 2010
@@ -100,7 +100,9 @@
                     SOAPMessage m = messageFactory.createMessage();
                     
                     Document doc = m.getSOAPHeader().getOwnerDocument();
-                    m.getSOAPHeader().appendChild(doc.importNode(approveResponseHeader, true));
+                    if (approveResponseHeader != null) {
+                        m.getSOAPHeader().appendChild(doc.importNode(approveResponseHeader,
true));
+                    }
                     return m;
                 } catch (Exception e) {
                     throw new RuntimeException("Error during receiving message ", e);

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
Tue Jan 26 12:14:14 2010
@@ -380,8 +380,8 @@
     }
 
     public void remove(String identifier) throws IllegalAccessFault, IllegalArgumentFault
{
-        // TODO Auto-generated method stub
-
+        Task t = Task.load(hiseEngine, Long.parseLong(identifier));
+        t.remove();
     }
 
     public void resume(String identifier) throws IllegalAccessFault, IllegalStateFault, IllegalArgumentFault
{

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISEDeployer.java
Tue Jan 26 12:14:14 2010
@@ -42,7 +42,7 @@
             TaskInfo ti = new HISEEngine.TaskInfo();
             ti.dd = t;
             ti.parent = di;
-            ti.taskKey = HISEEngine.tasksKey(d.getInterface().getPortType(), d.getInterface().getOperation());
+            ti.taskKey = HISEEngine.tasksKey(d.getTaskInterface().getPortType(), d.getTaskInterface().getOperation());
             ti.taskDefinition = d;
             hiseEngine.registerTask(ti);
         }

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HumanInteractionsCompiler.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HumanInteractionsCompiler.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HumanInteractionsCompiler.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HumanInteractionsCompiler.java
Tue Jan 26 12:14:14 2010
@@ -35,7 +35,9 @@
 import org.apache.hise.lang.TaskDefinition;
 import org.apache.hise.lang.xsd.htd.TGenericHumanRole;
 import org.apache.hise.lang.xsd.htd.THumanInteractions;
+import org.apache.hise.lang.xsd.htd.TNotification;
 import org.apache.hise.lang.xsd.htd.TTask;
+import org.apache.hise.lang.xsd.htd.TTaskInterface;
 import org.apache.hise.utils.DOMUtils;
 import org.springframework.core.io.Resource;
 import org.w3c.dom.Document;
@@ -76,26 +78,38 @@
 
         HumanInteractions humanInteractions = new HumanInteractions();
 
-        for (TTask tTask : hiDoc.getTasks().getTask()) {
-            TaskDefinition taskDefinition = new TaskDefinition(tTask, this.xmlNamespaces,
hiDoc.getTargetNamespace());
-            compileTaskDef(taskDefinition);
-            
-            QName name = taskDefinition.getTaskName();
-            if (humanInteractions.getTaskDefinitions().containsKey(name)) {
-                throw new RuntimeException("Duplicate task found, name: " + name + " resource:
" + resource);
+        if (hiDoc.getTasks() != null) {
+            for (TTask tTask : hiDoc.getTasks().getTask()) {
+                TaskDefinition taskDefinition = new TaskDefinition(tTask, this.xmlNamespaces,
hiDoc.getTargetNamespace());
+                taskDefinition.setTaskInterface(tTask.getInterface());
+                
+                QName name = taskDefinition.getTaskName();
+                if (humanInteractions.getTaskDefinitions().containsKey(name)) {
+                    throw new RuntimeException("Duplicate task found, name: " + name + "
resource: " + resource);
+                }
+                humanInteractions.getTaskDefinitions().put(name, taskDefinition);
+            }
+        }
+
+        if (hiDoc.getNotifications() != null) {
+            for (TNotification tnote : hiDoc.getNotifications().getNotification()) {
+                TaskDefinition taskDefinition = new TaskDefinition(tnote, this.xmlNamespaces,
hiDoc.getTargetNamespace());
+                TTaskInterface x = new TTaskInterface();
+                x.setOperation(tnote.getInterface().getOperation());
+                x.setPortType(tnote.getInterface().getPortType());
+                taskDefinition.setTaskInterface(x);
+                
+                QName name = taskDefinition.getTaskName();
+                if (humanInteractions.getTaskDefinitions().containsKey(name)) {
+                    throw new RuntimeException("Duplicate task found, name: " + name + "
resource: " + resource);
+                }
+                humanInteractions.getTaskDefinitions().put(name, taskDefinition);
             }
-            humanInteractions.getTaskDefinitions().put(name, taskDefinition);
         }
 
         return humanInteractions;
     }
 
-    void compileTaskDef(TaskDefinition t) {
-        for (JAXBElement<TGenericHumanRole> e: t.gettTask().getPeopleAssignments().getGenericHumanRole())
{
-            log.debug(e);
-        }
-    }
-    
     // /**
     // * Creates HumanInteractions instance, passing DOM Document instance to its constructor.
     // *

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/TaskDefinition.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/TaskDefinition.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/TaskDefinition.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/lang/TaskDefinition.java
Tue Jan 26 12:14:14 2010
@@ -26,8 +26,12 @@
 import org.apache.commons.lang.Validate;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hise.lang.xsd.htd.TDeadlines;
 import org.apache.hise.lang.xsd.htd.TFrom;
 import org.apache.hise.lang.xsd.htd.TLiteral;
+import org.apache.hise.lang.xsd.htd.TNotification;
+import org.apache.hise.lang.xsd.htd.TPeopleAssignments;
+import org.apache.hise.lang.xsd.htd.TPriority;
 import org.apache.hise.lang.xsd.htd.TTask;
 import org.apache.hise.lang.xsd.htd.TTaskInterface;
 import org.apache.hise.utils.DOMUtils;
@@ -49,7 +53,11 @@
 
     private final TTask tTask;
 
-    private String targetNamespace; 
+    private final TNotification tNote;
+
+    private String targetNamespace;
+    
+    private TTaskInterface taskInterface;
     
     /**
      * XML namespaces supported in human task definitions.
@@ -64,17 +72,25 @@
 
         Validate.notNull(taskDefinition);
 
+        this.tNote = null;
         this.tTask = taskDefinition;
         this.xmlNamespaces = xmlNamespaces;
         this.targetNamespace = targetNamespace;
     }
 
-    
-    public TTaskInterface getInterface() {
-        return tTask.getInterface();
+    public TaskDefinition(TNotification taskDefinition, Map<String, String> xmlNamespaces,
String targetNamespace) {
+
+        super();
+
+        Validate.notNull(taskDefinition);
+
+        this.tNote = taskDefinition;
+        this.tTask = null;
+        this.xmlNamespaces = xmlNamespaces;
+        this.targetNamespace = targetNamespace;
     }
-    
-    
+
+     
     
 //    /**
 //     * Returns description of the Task.
@@ -281,12 +297,28 @@
 //        return this.templateEngine.merge(subjectTemplate, presentationParameterValues).trim();
 //    }
 
+    public TTaskInterface getTaskInterface() {
+        return taskInterface;
+    }
+
+    public void setTaskInterface(TTaskInterface taskInterface) {
+        this.taskInterface = taskInterface;
+    }
+
+    private String getName() {
+        return isNotification() ? tNote.getName() : tTask.getName();
+    }
+    
     public QName getTaskName() {
-        return DOMUtils.uniqueQName(new QName(targetNamespace, this.tTask.getName()));
+        return DOMUtils.uniqueQName(new QName(targetNamespace, getName()));
     }
 
-    public TTask gettTask() {
-        return tTask;
+//    public TTask gettTask() {
+//        return tTask;
+//    }
+    
+    public TPeopleAssignments getPeopleAssignments() {
+        return isNotification() ? tNote.getPeopleAssignments() : tTask.getPeopleAssignments();
     }
     
     public String getOutcomeExpression() {
@@ -301,4 +333,17 @@
     public String getNamespaceURI(String prefix) {
         return this.xmlNamespaces == null ? null : this.xmlNamespaces.get(prefix);
     }
+
+
+    public boolean isNotification() {
+        return tNote != null;
+    }
+    
+    public TPriority getPriority() {
+        return isNotification() ? tNote.getPriority() : tTask.getPriority();
+    }
+    
+    public TDeadlines getDeadlines() {
+        return tTask.getDeadlines();
+    }
 }

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/DeadlineController.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/DeadlineController.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/DeadlineController.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/DeadlineController.java
Tue Jan 26 12:14:14 2010
@@ -50,7 +50,7 @@
     public void stateChanged(Status oldStatus, Status newStatus) {
         __log.debug(task + " " + oldStatus + " " + newStatus);
         
-        TDeadlines deadlines = task.getTaskDefinition().gettTask().getDeadlines();
+        TDeadlines deadlines = task.getTaskDefinition().getDeadlines();
         if (deadlines == null) {
             deadlines = new TDeadlines();
         }

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java Tue
Jan 26 12:14:14 2010
@@ -22,24 +22,10 @@
 import java.util.ArrayList;
 import java.util.Calendar;
 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.persistence.EntityManager;
-import javax.xml.namespace.QName;
-
-import net.sf.saxon.Configuration;
-import net.sf.saxon.dom.NodeOverNodeInfo;
-import net.sf.saxon.dom.NodeWrapper;
-import net.sf.saxon.om.NodeInfo;
-import net.sf.saxon.query.DynamicQueryContext;
-import net.sf.saxon.query.StaticQueryContext;
-import net.sf.saxon.query.XQueryExpression;
-import net.sf.saxon.trans.XPathException;
-
 import org.apache.commons.lang.Validate;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -47,21 +33,16 @@
 import org.apache.hise.dao.HISEDao;
 import org.apache.hise.dao.Job;
 import org.apache.hise.dao.Message;
-import org.apache.hise.dao.OrgEntity;
-import org.apache.hise.dao.PresentationParameter;
 import org.apache.hise.dao.TaskOrgEntity;
 import org.apache.hise.dao.Task.Status;
 import org.apache.hise.dao.TaskOrgEntity.OrgEntityType;
 import org.apache.hise.engine.HISEEngine;
-import org.apache.hise.engine.HISEScheduler;
 import org.apache.hise.lang.TaskDefinition;
-import org.apache.hise.lang.xsd.htd.TExpression;
 import org.apache.hise.lang.xsd.htd.TGrouplist;
 import org.apache.hise.lang.xsd.htd.TOrganizationalEntity;
 import org.apache.hise.lang.xsd.htd.TUserlist;
 import org.apache.hise.utils.DOMUtils;
 import org.apache.hise.utils.XmlUtils;
-import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 
 /**
@@ -122,14 +103,16 @@
         return hiseEngine;
     }
 
-    private Task(HISEEngine engine) {
+    private Task(HISEEngine engine, boolean notification) {
         this.hiseEngine = engine;
         Validate.notNull(hiseEngine);
 
         taskStateListeners = new ArrayList<TaskStateListener>();
-        taskStateListeners.add(new TaskLifecycle(this));
-        deadlineController = new DeadlineController(this);
-        taskStateListeners.add(deadlineController);
+        if (!notification) {
+            taskStateListeners.add(new TaskLifecycle(this));
+            deadlineController = new DeadlineController(this);
+            taskStateListeners.add(deadlineController);
+        }
 
         taskEvaluator = new TaskEvaluator(this);
     }
@@ -151,10 +134,10 @@
     }
 
     public static Task load(HISEEngine engine, Long id) {
-        Task t = new Task(engine);
         HISEDao dao = engine.getHiseDao();
-        t.taskDto = dao.find(org.apache.hise.dao.Task.class, id);
-        // t.setTaskDto(em.find(Task.class, , arg1)engine.taskDao.fetch(id));
+        org.apache.hise.dao.Task dto = dao.find(org.apache.hise.dao.Task.class, id);
+        Task t = new Task(engine, dto.isNotification());
+        t.taskDto = dto;
         t.taskDefinition = engine.getTaskDefinition(t.taskDto.getTaskDefinitionName());
         return t;
     }
@@ -180,8 +163,9 @@
     }
     
     public static Task create(HISEEngine engine, TaskDefinition taskDefinition, String createdBy,
Node requestXml, Node requestHeader) {
-        Task t = new Task(engine);
+        Task t = new Task(engine, false);
         Validate.notNull(taskDefinition);
+        Validate.isTrue(!taskDefinition.isNotification());
         t.taskDefinition = taskDefinition;
         org.apache.hise.dao.Task u = new org.apache.hise.dao.Task();
         u.setTaskDefinitionKey(taskDefinition.getTaskName().toString());
@@ -247,6 +231,33 @@
         //        
         // recalculatePriority();
     }
+
+    public static Task createNotification(HISEEngine engine, TaskDefinition taskDefinition,
String createdBy, Node requestXml, Node requestHeader) {
+        Task t = new Task(engine, true);
+        Validate.notNull(taskDefinition);
+        Validate.isTrue(taskDefinition.isNotification());
+        t.taskDefinition = taskDefinition;
+        org.apache.hise.dao.Task u = new org.apache.hise.dao.Task();
+        u.setTaskDefinitionKey(taskDefinition.getTaskName().toString());
+        u.setCreatedBy(createdBy);
+        u.setStatus(null);
+        u.getInput().put("request", new Message("request", DOMUtils.domToString(requestXml)));
+        u.getInput().put("requestHeader", new Message("requestHeader", DOMUtils.domToString(requestHeader)));
+        u.setCreatedOn(new Date());
+        u.setActivationTime(new Date());
+        u.setEscalated(false);
+        u.setNotification(true);
+        t.taskDto = u;
+        t.setStatus(Status.CREATED);
+
+        u.setPeopleAssignments(t.getTaskEvaluator().evaluatePeopleAssignments());
+        
+        t.setStatus(Status.READY);
+        engine.getHiseDao().persist(u);
+        
+        return t;
+    }
+
     
     public void setActualOwner(String user) {
         taskDto.setActualOwner(user);
@@ -1088,4 +1099,9 @@
     public Date calculateWakeupTime() {
         return null;
     }
+    
+    public void remove() {
+        Validate.isTrue(taskDto.isNotification());
+        hiseEngine.getHiseDao().remove(taskDto);
+    }
 }

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskEvaluator.java
Tue Jan 26 12:14:14 2010
@@ -79,7 +79,7 @@
     }
     
     public Integer evaluatePriority() {
-        return Integer.parseInt("" + evaluateExpression(task.getTaskDefinition().gettTask().getPriority()));
+        return Integer.parseInt("" + evaluateExpression(task.getTaskDefinition().getPriority()));
     }
 
     private List evaluateExpression(TExpression expr) {
@@ -92,7 +92,7 @@
     
     public Set<TaskOrgEntity> evaluatePeopleAssignments() {
         Set<TaskOrgEntity> result = new HashSet<TaskOrgEntity>();
-        TPeopleAssignments p = task.getTaskDefinition().gettTask().getPeopleAssignments();
+        TPeopleAssignments p = task.getTaskDefinition().getPeopleAssignments();
 
         for (JAXBElement<TGenericHumanRole> r : p.getGenericHumanRole()) {
             GenericHumanRole assignmentRole = GenericHumanRole.valueOf(r.getName().getLocalPart().toUpperCase());
@@ -176,7 +176,7 @@
     
     public EscalationResult findEscalation(String name) {
         EscalationResult r = null;
-        TDeadlines d = task.getTaskDefinition().gettTask().getDeadlines();
+        TDeadlines d = task.getTaskDefinition().getDeadlines();
         for (TDeadline u : d.getStartDeadline()) {
             for (TEscalation e : u.getEscalation()) {
                 if (getEscalationKey(e, false).equals(name)) {

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/DOMUtils.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/DOMUtils.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/DOMUtils.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/DOMUtils.java Tue
Jan 26 12:14:14 2010
@@ -172,7 +172,11 @@
         return d;
     }
 
-    public static Document parse(String in) throws Exception {
-        return parse(new ByteArrayInputStream(in.getBytes()));
+    public static Document parse(String in) {
+        try {
+            return parse(new ByteArrayInputStream(in.getBytes()));
+        } catch (Exception e) {
+            throw new RuntimeException("", e);
+        }
     }
 }

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/XQueryEvaluator.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/XQueryEvaluator.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/XQueryEvaluator.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/utils/XQueryEvaluator.java
Tue Jan 26 12:14:14 2010
@@ -75,10 +75,16 @@
         this.contextObject = contextObject;
     }
 
-    public static ValueRepresentation convertJavaToSaxon(Object obj) {
+    public ValueRepresentation convertJavaToSaxon(Object obj) {
         try {
             if (obj == null) obj = "";
-            return JPConverter.allocate(obj.getClass(), null).convert(obj, null);
+            
+            if (obj instanceof Node) {
+                NodeInfo v = new DocumentWrapper((Node) obj, "", config).getRoot();
+                return v;
+            } else { 
+                return JPConverter.allocate(obj.getClass(), null).convert(obj, null);
+            }
         } catch (XPathException e) {
             throw new RuntimeException("", e);
         }
@@ -126,6 +132,7 @@
                         throw new RuntimeException("Error converting result", e1);
                     }
                 }
+//                o2 = JavaDOMWrapper.unwrap(o2);
                 value2.add(o2);
             }
             __log.debug("result for expression " + expr + " " + value2 + " value class "
+ (value2 == null ? null : value2.getClass()));

Modified: incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/CompilerTest.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/CompilerTest.java?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/CompilerTest.java (original)
+++ incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/CompilerTest.java Tue
Jan 26 12:14:14 2010
@@ -43,7 +43,10 @@
         Assert.assertTrue(s.contains(QName.valueOf("{http://www.insurance.example.com/claims}Task1")));
         Assert.assertTrue(s.contains(QName.valueOf("{http://www.insurance.example.com/claims}Task2")));
         Assert.assertTrue(s.contains(QName.valueOf("{http://www.insurance.example.com/claims}Task3")));
+        Assert.assertTrue(s.contains(QName.valueOf("{http://www.insurance.example.com/claims}Notify2")));
         Assert.assertEquals("someOutput", hi.getTaskDefinitions().get(QName.valueOf("{http://www.insurance.example.com/claims}Task1")).getOutcomeExpression());
+        Assert.assertEquals("approve", hi.getTaskDefinitions().get(QName.valueOf("{http://www.insurance.example.com/claims}Task1")).getTaskInterface().getOperation());
+        Assert.assertEquals("notify", hi.getTaskDefinitions().get(QName.valueOf("{http://www.insurance.example.com/claims}Notify2")).getTaskInterface().getOperation());
     }
     
     @Test

Modified: incubator/hise/trunk/hise-services/src/test/resources/testHtd1.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/test/resources/testHtd1.xml?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/test/resources/testHtd1.xml (original)
+++ incubator/hise/trunk/hise-services/src/test/resources/testHtd1.xml Tue Jan 26 12:14:14
2010
@@ -362,5 +362,29 @@
     </htd:completionDeadline>
   </htd:deadlines>
         </htd:task>    
-    </htd:tasks>    
+    </htd:tasks>
+    
+    <htd:notifications>
+      <htd:notification name="Notify2">
+        <htd:interface portType="tns:ClaimApprovalReminderPT" operation="notify"></htd:interface>
+        <htd:peopleAssignments>
+          <htd:potentialOwners>
+            <htd:from>
+              <htd:literal>
+                <htd:organizationalEntity>
+                  <htd:users>
+                    <htd:user>user5</htd:user>
+                  </htd:users>
+                </htd:organizationalEntity>
+              </htd:literal>
+            </htd:from>
+          </htd:potentialOwners>
+        </htd:peopleAssignments>
+        <htd:presentationElements>
+          <htd:name>Notify2Name</htd:name>
+          <htd:subject>Name2Subject</htd:subject>
+        </htd:presentationElements>
+      </htd:notification>
+    </htd:notifications>
+        
 </htd:humanInteractions>

Modified: incubator/hise/trunk/hise-test-example/src/main/resources/ExampleTasks.wsdl
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example/src/main/resources/ExampleTasks.wsdl?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example/src/main/resources/ExampleTasks.wsdl (original)
+++ incubator/hise/trunk/hise-test-example/src/main/resources/ExampleTasks.wsdl Tue Jan 26
12:14:14 2010
@@ -72,14 +72,12 @@
       <wsdl:output message="tns:ClaimResolveResponse" />
     </wsdl:operation>
   </wsdl:portType>
-  <!-- 
   <wsdl:portType name="ClaimApprovalReminderPT">
     <wsdl:operation name="notify">
       <wsdl:input message="tns:notifyRequest" />
       <wsdl:output message="tns:notifyResponse" />
     </wsdl:operation>
   </wsdl:portType>
-   -->
 
   <wsdl:binding name="ClaimsHandlingBinding" type="tns:ClaimsHandlingPT">
     <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
@@ -125,4 +123,22 @@
       <soap:address location="http://localhost:9999"/> <!--some non existing destination,
since it has to be initialized from callback EPR -->
     </wsdl:port>
   </wsdl:service>
+
+  <wsdl:binding name="ClaimApprovalReminderBinding" type="tns:ClaimApprovalReminderPT">
+    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
+    <wsdl:operation name="notify">
+      <soap:operation/>
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://www.insurance.example.com/claims" />
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal" namespace="http://www.insurance.example.com/claims" />
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="ClaimApprovalReminderService">
+    <wsdl:port name="ClaimApprovalReminderPort" binding="tns:ClaimApprovalReminderBinding">
+      <soap:address location="http://localhost:8090"/> <!--some non existing destination,
since it has to be initialized from callback EPR -->
+    </wsdl:port>
+  </wsdl:service>
 </wsdl:definitions>

Modified: incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-hise-dd.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-hise-dd.xml?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-hise-dd.xml (original)
+++ incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1-hise-dd.xml Tue Jan
26 12:14:14 2010
@@ -23,6 +23,15 @@
               <property name="handler" ref="hiseJaxWSService1"/>
               <property name="sender" ref="hiseJaxWSSender1"/>
             </bean>
+            
+            <bean class="org.apache.hise.engine.store.TaskDD">
+              <property name="taskName">
+                <bean class="javax.xml.namespace.QName" factory-method="valueOf">
+                  <constructor-arg type="java.lang.String" value="{http://www.insurance.example.com/claims}Notify2"></constructor-arg>
+                </bean>
+              </property>
+              <property name="handler" ref="hiseJaxWSService1"/>
+            </bean>
           </list>
         </property>
       </bean>
@@ -67,5 +76,7 @@
 <!-- 
   <jaxws:client id="testHtd1Sender" address="http://localhost:9999" wsdlLocation="classpath:ExampleTasks.wsdl"/>
    -->
+  <jaxws:endpoint id="testHtd2" address="/ClaimApprovalReminderService/" implementor="#hiseJaxWSService1"
serviceName="ins:ClaimApprovalReminderService" endpointName="ins:ClaimApprovalReminderPort"
publish="true" wsdlLocation="classpath:ExampleTasks.wsdl"/>
+   
 </beans>    
 

Modified: incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1.xml?rev=903192&r1=903191&r2=903192&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1.xml (original)
+++ incubator/hise/trunk/hise-test-example/src/main/resources/testHtd1.xml Tue Jan 26 12:14:14
2010
@@ -336,7 +336,7 @@
   <htd:deadlines>
     <htd:startDeadline>
       <htd:for>PT5S</htd:for>
-      <htd:escalation name="reassignTask3">
+      <htd:escalation name="startDeadline1">
         <htd:reassignment>
           <htd:potentialOwners>
             <htd:from>
@@ -353,6 +353,30 @@
         </htd:reassignment>
       </htd:escalation>
     </htd:startDeadline>
+    
+    <htd:startDeadline>
+      <htd:for>PT5S</htd:for>
+      <htd:escalation name="startDeadline2">
+        <htd:localNotification reference="tns:Notify2"/>
+      </htd:escalation>
+    </htd:startDeadline>
+    
+    <!-- 
+    <htd:startDeadline>
+      <htd:for>PT5S</htd:for>
+      <htd:escalation name="startDeadline3">
+        <htd:notification name="NotifyInline">
+          <htd:interface portType="req" operation="notify"></htd:interface>
+          <htd:priority>2</htd:priority>
+          <htd:peopleAssignments>
+          </htd:peopleAssignments>
+          <htd:presentationElements>
+          </htd:presentationElements>
+        </htd:notification>
+      </htd:escalation>
+    </htd:startDeadline>
+     -->
+    
     <htd:completionDeadline>
       <htd:for>PT10S</htd:for>
       <htd:escalation name="reassignTask3Completion">
@@ -374,4 +398,27 @@
   </htd:deadlines>
         </htd:task>    
     </htd:tasks>    
+    
+    <htd:notifications>
+      <htd:notification name="Notify2">
+        <htd:interface portType="tns:ClaimApprovalReminderPT" operation="notify"></htd:interface>
+        <htd:peopleAssignments>
+          <htd:potentialOwners>
+            <htd:from>
+              <htd:literal>
+                <htd:organizationalEntity>
+                  <htd:users>
+                    <htd:user>user5</htd:user>
+                  </htd:users>
+                </htd:organizationalEntity>
+              </htd:literal>
+            </htd:from>
+          </htd:potentialOwners>
+        </htd:peopleAssignments>
+        <htd:presentationElements>
+          <htd:name>Notify2Name</htd:name>
+          <htd:subject>Name2Subject</htd:subject>
+        </htd:presentationElements>
+      </htd:notification>
+    </htd:notifications>
 </htd:humanInteractions>



Mime
View raw message