incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wi...@apache.org
Subject svn commit: r926514 - in /incubator/hise/trunk/hise-services/src/main/java/org/apache/hise: engine/HISEEngineImpl.java engine/jaxws/TaskOperationsImpl.java runtime/Task.java
Date Tue, 23 Mar 2010 10:06:06 GMT
Author: witek
Date: Tue Mar 23 10:06:05 2010
New Revision: 926514

URL: http://svn.apache.org/viewvc?rev=926514&view=rev
Log:
setOutput

Modified:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.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/runtime/Task.java

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java?rev=926514&r1=926513&r2=926514&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/HISEEngineImpl.java
Tue Mar 23 10:06:05 2010
@@ -47,6 +47,7 @@ public class HISEEngineImpl implements H
     
     public final Map<String, QName> tasksMap = new HashMap<String, QName>();
     public final Map<QName, TaskInfo> tasks = new HashMap<QName, TaskInfo>();
+
     private HISEDao hiseDao;
     private HISEUserDetails hiseUserDetails;
     

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=926514&r1=926513&r2=926514&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 Mar 23 10:06:05 2010
@@ -31,6 +31,8 @@ import javax.xml.namespace.QName;
 import javax.xml.ws.Holder;
 import javax.xml.ws.WebServiceContext;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hise.dao.GenericHumanRole;
 import org.apache.hise.dao.TaskQuery;
 import org.apache.hise.engine.HISEEngineImpl;
@@ -57,6 +59,7 @@ import org.apache.hise.lang.xsd.htda.TTa
 import org.apache.hise.lang.xsd.htdt.TTime;
 import org.apache.hise.runtime.Task;
 import org.springframework.transaction.annotation.Transactional;
+import org.w3c.dom.Node;
 
 /**
  * Implementation of WS-HT API. Operations are executed by end users, i.e.
@@ -74,6 +77,8 @@ import org.springframework.transaction.a
 @Transactional
 @WebService
 public class TaskOperationsImpl implements TaskOperations {
+    
+    private static Log log = LogFactory.getLog(TaskOperationsImpl.class);
 
     private HISEEngineImpl hiseEngine;
 
@@ -237,8 +242,16 @@ public class TaskOperationsImpl implemen
     public void complete(String identifier, Object taskData) throws IllegalAccessFault, IllegalStateFault,
IllegalArgumentFault {
         Task t = Task.load(hiseEngine, Long.parseLong(identifier));
         t.setCurrentUser(getUserString());
+        //TODO set output
+        //t.setOutput(((Node) taskData).getFirstChild());
         t.complete();
     }
+
+    public void setOutput(String identifier, String part, Object taskData) throws IllegalAccessFault,
IllegalStateFault, IllegalArgumentFault {
+        Task t = Task.load(hiseEngine, Long.valueOf(identifier));
+        t.setCurrentUser(getUserString());
+        t.setOutput(((Node) taskData).getFirstChild());
+    }
     
     // not started
 
@@ -327,11 +340,6 @@ public class TaskOperationsImpl implemen
 
     }
 
-    public void setOutput(String identifier, String part, Object taskData) throws IllegalAccessFault,
IllegalStateFault, IllegalArgumentFault {
-        // TODO Auto-generated method stub
-
-    }
-
     public void setPriority(String identifier, BigInteger priority) throws IllegalAccessFault,
IllegalStateFault, IllegalArgumentFault {
         // TODO Auto-generated method stub
 

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=926514&r1=926513&r2=926514&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
Mar 23 10:06:05 2010
@@ -242,29 +242,33 @@ public class Task {
     }
 
     public static Task createNotification(HISEEngineImpl engine, TaskDefinition taskDefinition,
String createdBy, Node requestXml, Node requestHeader) {
-        Task t = new Task(engine, true);
+        
         Validate.notNull(taskDefinition);
         Validate.isTrue(taskDefinition.isNotification());
+        
+        Task t = new Task(engine, true);
+        
         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);
-        engine.getHiseDao().persist(u);
+
+        org.apache.hise.dao.Task taskDto = new org.apache.hise.dao.Task();
+        taskDto.setTaskDefinitionKey(taskDefinition.getTaskName().toString());
+        taskDto.setCreatedBy(createdBy);
+        taskDto.setStatus(null);
+        taskDto.getInput().put("request", new Message("request", DOMUtils.domToString(requestXml)));
+        taskDto.getInput().put("requestHeader", new Message("requestHeader", DOMUtils.domToString(requestHeader)));
+        taskDto.setCreatedOn(new Date());
+        taskDto.setActivationTime(new Date());
+        taskDto.setEscalated(false);
+        taskDto.setNotification(true);
+        engine.getHiseDao().persist(taskDto);
         
-        t.taskDto = u;
+        t.taskDto = taskDto;
         t.setStatus(Status.CREATED);
 
-        u.setPeopleAssignments(t.getTaskEvaluator().evaluatePeopleAssignments());
+        taskDto.setPeopleAssignments(t.getTaskEvaluator().evaluatePeopleAssignments());
         
         t.setStatus(Status.READY);
-        engine.getHiseDao().persist(u);
+        engine.getHiseDao().persist(taskDto);
         
         return t;
     }
@@ -275,6 +279,10 @@ public class Task {
         setStatus(Status.RESERVED);
     }
     
+    public void setOutput(Node requestXml) {
+        __log.debug("setting task output to: " + requestXml);
+        this.taskDto.getOutput().put("request", new Message("request", DOMUtils.domToString(requestXml)));
+    }
 
     public TaskDefinition getTaskDefinition() {
         return taskDefinition;
@@ -596,6 +604,9 @@ public class Task {
         sendResponse();
     }
     
+    /**
+     * FIXME is outcome a reponse?
+     */
     private void sendResponse() {
         try {
             Node response = taskEvaluator.evaluateOutcome(taskDto.getStatus() == Status.COMPLETED);



Mime
View raw message