incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r.@apache.org
Subject svn commit: r967002 [1/3] - in /incubator/hise/trunk: hise-services/src/main/java/org/apache/hise/dao/ 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/...
Date Fri, 23 Jul 2010 08:30:16 GMT
Author: rr
Date: Fri Jul 23 08:30:15 2010
New Revision: 967002

URL: http://svn.apache.org/viewvc?rev=967002&view=rev
Log:
HISE-53: task history in comments (Thanks to Paweł Byszewski)

Added:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskHistoryListener.java
    incubator/hise/trunk/itest/task_history.xml
Modified:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java
    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/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/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/test/java/org/apache/hise/DaoTest.java
    incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
    incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml
    incubator/hise/trunk/hise-wsdl/src/main/resources/ws-humantask.xsd
    incubator/hise/trunk/itest/hise-soapui-project.xml

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java?rev=967002&r1=967001&r2=967002&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Comment.java Fri
Jul 23 08:30:15 2010
@@ -67,6 +67,12 @@ public class Comment extends JpaBase {
         this.task = taskDto;
         this.userName = userName;
 	}
+    
+    public Comment(final String content, final String userName) {
+        this.content = content;
+        this.date = new Date();
+        this.userName = userName;
+	}
 
     public Date getDate() {
         return this.date;

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java?rev=967002&r1=967001&r2=967002&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java Fri Jul
23 08:30:15 2010
@@ -227,8 +227,18 @@ public class Task extends JpaBase {
     private Job suspendUntil;
 
     private boolean skippable;
+    
+    private boolean savingStateHistory;
+
+    public boolean isSavingTaskHistory() {
+		return savingStateHistory;
+	}
+
+	public void setSavingTaskHistory(boolean savingStateHistory) {
+		this.savingStateHistory = savingStateHistory;
+	}
 
-    private boolean escalated;
+	private boolean escalated;
     
     private boolean notification = false;
 
@@ -260,6 +270,7 @@ public class Task extends JpaBase {
 //    private Set<TaskOrgEntity> notificationRecipients;
 
     @OneToMany(mappedBy = "task", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
+    @javax.persistence.OrderBy("date")
     private List<Comment> comments = new ArrayList<Comment>();
 
     @OneToMany(mappedBy = "task", cascade = { CascadeType.PERSIST, CascadeType.MERGE })

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=967002&r1=967001&r2=967002&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
Fri Jul 23 08:30:15 2010
@@ -164,7 +164,7 @@ public class HISEEngineImpl implements H
         if (def.isNotification()) {
             t = Task.createNotification(this, getTaskDefinition(taskName), createdBy, body,
requestHeader);
         } else {
-            t = Task.create(this, getTaskDefinition(taskName), createdBy, body, requestHeader);
+            t = Task.create(this, getTaskDefinition(taskName), createdBy, body, requestHeader,
createdBy);
         }
         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=967002&r1=967001&r2=967002&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
Fri Jul 23 08:30:15 2010
@@ -97,7 +97,6 @@ public class HISEJaxWSService implements
                     QName operation = (QName) operationInfo.getClass().getMethod("getName").invoke(operationInfo);
                     QName portType = (QName) c.get("javax.xml.ws.wsdl.interface");
                     QName operation2 = (QName) c.get("javax.xml.ws.wsdl.operation");
-
                     Element body = request.getSOAPBody();
                     __log.debug("invoking " + request + " operation:" + operation + " portType:"
+ portType + " operation2:" + operation2);
                     Node approveResponseHeader = hiseEngine.receive(HISEJaxWSService.this,
portType, operation.getLocalPart(), body, request.getSOAPHeader());

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=967002&r1=967001&r2=967002&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
Fri Jul 23 08:30:15 2010
@@ -402,6 +402,7 @@ public class TaskOperationsImpl implemen
     	Task task = Task.load(hiseEngine, new Long(identifier));
         if(!(TaskChecker.checkPermission(TaskChecker.HumanOperationName.ACTIVATE, getUserString(),
task))) 
         	throw new IllegalAccessFault("Illegal access to operations");
+        task.setCurrentUser(getUserString());
         // TODO Auto-generated method stub
 
     }
@@ -432,13 +433,13 @@ public class TaskOperationsImpl implemen
 
     public void delegate(String identifier, TOrganizationalEntity organizationalEntity) throws
IllegalAccessFault, IllegalStateFault, RecipientNotAllowed,
             IllegalArgumentFault {
-
         Task task = Task.load(hiseEngine, new Long(identifier));
         if(!(TaskChecker.checkPermission(TaskChecker.HumanOperationName.DELEGATE, getUserString(),
task))) 
         	throw new IllegalAccessFault("Illegal access to operations");
         
         String userID = task.checkCanDelegate(organizationalEntity);
         org.apache.hise.dao.Task taskDto = task.getTaskDto();
+        task.setCurrentUser(getUserString());
         
         try {
 			task.setActualOwner(userID);
@@ -457,6 +458,7 @@ public class TaskOperationsImpl implemen
         	taskDto.setPeopleAssignments(peopeAssignments);
         }
     }
+    
 
     public void deleteAttachments(String identifier, String attachmentName) throws IllegalAccessFault,
IllegalStateFault, IllegalArgumentFault {
         Task task = Task.load(hiseEngine, new Long(identifier));
@@ -486,7 +488,7 @@ public class TaskOperationsImpl implemen
     	Task task = Task.load(hiseEngine, new Long(identifier));
         if(!(TaskChecker.checkPermission(TaskChecker.HumanOperationName.DELELE_FAULT, getUserString(),
task))) 
         	throw new IllegalAccessFault("Illegal access to operations");
-        
+        task.setCurrentUser(getUserString());
         // TODO Auto-generated method stub
 
     }
@@ -495,7 +497,7 @@ public class TaskOperationsImpl implemen
     	Task task = Task.load(hiseEngine, new Long(identifier));
         if(!(TaskChecker.checkPermission(TaskChecker.HumanOperationName.DELETE_OUTPUT, getUserString(),
task))) 
         	throw new IllegalAccessFault("Illegal access to operations");
-        
+        task.setCurrentUser(getUserString());
         // TODO Auto-generated method stub
 
     }
@@ -646,7 +648,7 @@ public class TaskOperationsImpl implemen
     	Task task = Task.load(hiseEngine, new Long(identifier));
         if(!(TaskChecker.checkPermission(TaskChecker.HumanOperationName.SET_FAULT, getUserString(),
task))) 
         	throw new IllegalAccessFault("Illegal access to operations");
-    	
+        task.setCurrentUser(getUserString());
         // TODO Auto-generated method stub
 
     }
@@ -677,6 +679,7 @@ public class TaskOperationsImpl implemen
         Task task = Task.load(hiseEngine, new Long(identifier));
         if(!(TaskChecker.checkPermission(TaskChecker.HumanOperationName.SKIP, getUserString(),
task))) 
         	throw new IllegalAccessFault("Illegal access to operations");
+        task.setCurrentUser(getUserString());
         org.apache.hise.dao.Task taskDto = task.getTaskDto();
         if(taskDto.isSkippable()){
         try {

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=967002&r1=967001&r2=967002&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
Fri Jul 23 08:30:15 2010
@@ -385,5 +385,8 @@ public class TaskDefinition {
 	public TDelegation getDelegation(){
 		return tTask.getDelegation();
 	}
+	public boolean isSavingTaskHistory(){
+			return tTask.isSavingTaskHistory();
+	}
    
 }

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=967002&r1=967001&r2=967002&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
Fri Jul 23 08:30:15 2010
@@ -108,6 +108,7 @@ public class DeadlineController implemen
             
             if (e.escalation.getReassignment() != null) {
                 Set<TaskOrgEntity> result = task.getTaskEvaluator().evaluateGenericHumanRole(e.escalation.getReassignment().getPotentialOwners(),
GenericHumanRole.POTENTIALOWNERS);
+                task.setCurrentUser("Dedline crossed");
                 task.forward(result);
             } else if (e.escalation.getLocalNotification() != null) {
                 Node request = msg.get("request");

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=967002&r1=967001&r2=967002&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 Fri
Jul 23 08:30:15 2010
@@ -43,6 +43,7 @@ import org.apache.commons.lang.Validate;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hise.api.PeopleQueryProvider;
+import org.apache.hise.dao.Comment;
 import org.apache.hise.dao.GenericHumanRole;
 import org.apache.hise.dao.HISEDao;
 import org.apache.hise.dao.Job;
@@ -93,8 +94,12 @@ public class Task {
     private String currentUser;
 
     private DeadlineController deadlineController;
+    
+    private TaskHistoryListener taskHistoryListener;
+    
 
-    protected Task() {}
+
+	protected Task() {}
     
 
     public Job getCurrentJob() {
@@ -118,7 +123,6 @@ public class Task {
     }
 
     /**
-     * TODO throw an exception if current user is not TASK_ADMINISTRATOR
      * @param currentUser
      */
     public void setCurrentUser(String currentUser) {
@@ -141,6 +145,8 @@ public class Task {
             deadlineController = new DeadlineController(this);
             taskStateListeners.add(deadlineController);
         }
+        
+        taskHistoryListener = new TaskHistoryListener();
 
         taskEvaluator = new TaskEvaluator(this);
     }
@@ -190,9 +196,10 @@ public class Task {
         }
     }
 
-    public static Task create(HISEEngineImpl engine, TaskDefinition taskDefinition, String
createdBy, Node requestXml, Node requestHeader) {
+    public static Task create(HISEEngineImpl engine, TaskDefinition taskDefinition, String
createdBy, Node requestXml, Node requestHeader, String initiatorName) {
 
         Task t = new Task(engine, false);
+        t.setCurrentUser(initiatorName);
         Validate.notNull(taskDefinition);
         Validate.isTrue(!taskDefinition.isNotification());
 
@@ -217,6 +224,7 @@ public class Task {
         taskDto.setEscalated(false);
         taskDto.setNotification(false);
         taskDto.setSkippable(true);
+        taskDto.setSavingTaskHistory(taskDefinition.isSavingTaskHistory());
         t.taskDto = taskDto;
         taskDto.setPeopleAssignments(t.getTaskEvaluator().evaluatePeopleAssignments());
         taskDto.setPotentalDelegates(t.getTaskEvaluator().evaluatePotentialDelegates());
@@ -245,7 +253,7 @@ public class Task {
         } catch (HiseIllegalStateException e) {
             t.__log.warn("Could not nominate owner.");
         }
-        
+        engine.getHiseDao().persist(taskDto);
         return t;
 
         // recalculatePresentationParameters();
@@ -291,7 +299,10 @@ public class Task {
         // recalculatePriority();
     }
 
-    static Map<String, Node> findInputParts(TaskDefinition taskDefinition, Node requestXml)
{
+
+
+
+	static Map<String, Node> findInputParts(TaskDefinition taskDefinition, Node requestXml)
{
         Map<String, Node> inputParts = new HashMap<String, Node>();
 
         Operation operation = taskDefinition.getPortType().getOperation(taskDefinition.getTaskInterface().getOperation(),
null, null);
@@ -378,8 +389,14 @@ public class Task {
     }
 
     public void setActualOwner(String user) throws HiseIllegalStateException {
-        setStatus(Status.RESERVED);
+        
+    	if(taskDto.isSavingTaskHistory()){
+    		Comment comment=taskHistoryListener.actualOwnerChanged(taskDto, taskDto.getActualOwner(),
user, getCurrentUser());
+    		taskDto.getComments().add(comment);
+    	}
         taskDto.setActualOwner(user);
+        setStatus(Status.RESERVED);
+        return;
     }
 
     public void setOutput(Node requestXml) {
@@ -559,10 +576,15 @@ public class Task {
     //
 
     public void setStatus(Status newStatus) throws HiseIllegalStateException {
-        for (TaskStateListener l : taskStateListeners) {
-        	Status stat=taskDto.getStatus();
-            l.stateChanged(stat, newStatus);
+     	Status oldStatus=null;
+    	for (TaskStateListener l : taskStateListeners) {
+        	oldStatus=taskDto.getStatus();
+            l.stateChanged(oldStatus, newStatus);
         }
+    	if(taskDto.isSavingTaskHistory()){
+        	Comment comment= taskHistoryListener.stateChanged(taskDto, oldStatus, newStatus,
getCurrentUser());
+        	taskDto.getComments().add(comment);
+    	}
         taskDto.setStatus(newStatus);
     }
 
@@ -692,10 +714,10 @@ public class Task {
         // throw new HTIllegalAccessException("Person is excluded from potential owners.",
person.getName());
         // }
 
-        taskDto.setActualOwner(currentUser);
+        setActualOwner(currentUser);
 
         // taskDto.addOperationComment(Operations.CLAIM, person);
-        setStatus(Status.RESERVED);
+        //setStatus(Status.RESERVED);
     }
 
     /**
@@ -776,7 +798,7 @@ public class Task {
 
     private void releaseOwner() throws HiseIllegalStateException {
         setStatus(Status.READY);
-        taskDto.setActualOwner(null);
+        setActualOwner(null);
     }
 
     public void forward(TOrganizationalEntity target) throws HiseIllegalStateException {
@@ -819,13 +841,14 @@ public class Task {
         taskDto.setPeopleAssignments(orgs);
         
         for (TaskOrgEntity x : old) {
-            if(x.getGenericHumanRole()!=GenericHumanRole.POTENTIALOWNERS){
+            if(x.getGenericHumanRole()==GenericHumanRole.POTENTIALOWNERS){
             	x.setTask(null);
             	hiseEngine.getHiseDao().remove(x);         
             }
         }
         tryNominateOwner();
-
+        __log.debug("forwarding to " + targets);
+        int k=targets.size();
     }
     
 

Added: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskHistoryListener.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskHistoryListener.java?rev=967002&view=auto
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskHistoryListener.java
(added)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/TaskHistoryListener.java
Fri Jul 23 08:30:15 2010
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.hise.runtime;
+
+import org.apache.hise.dao.Comment;
+import org.apache.hise.dao.Task.Status;
+
+/**
+ * @author Paweł Byszewski
+ *
+ */
+public class TaskHistoryListener {
+
+	public enum mode{
+		STATE_CHANGE,
+		ACTUALOWNER_CHANGE
+	}
+	
+	public Comment stateChanged(org.apache.hise.dao.Task taskDto, org.apache.hise.dao.Task.Status
oldStatus,
+			org.apache.hise.dao.Task.Status newStatus, String initiator) {
+		 if(initiator==null) throw new RuntimeException("Initiator name missing");
+		String content=null;
+        if(newStatus==Status.CREATED)
+        	content=new String("Zadanie zostało utworzone.");
+        else{
+        	content=new String("Zmienił się stan zadania z "+new String(oldStatus.toString())
+        			+" na "+new String(newStatus.toString())+".");
+        }
+        Comment comment= new Comment(content, taskDto, initiator);
+        return comment;
+		
+	}
+	
+	 public Comment actualOwnerChanged(org.apache.hise.dao.Task taskDto, String oldActualOwner,

+			 	String newActualOwner, String initiator ){
+		 if(initiator==null) throw new RuntimeException("Initiator name missing");
+     	if((oldActualOwner==null || oldActualOwner.isEmpty()) &&
+     			(newActualOwner==null || newActualOwner.isEmpty()))
+     		throw new RuntimeException("Names of old and new ActualOwner missing");
+     	
+			String content=null;
+	        if(oldActualOwner==null || oldActualOwner.isEmpty())
+	        	content=new String("Jako Actual Owner zadania został przypisany "+newActualOwner+".");
+	        else if(newActualOwner==null || newActualOwner.isEmpty()){
+	        	content=new String("Zwolniono stanowisko Actual Owner. Był tam przypisany "+oldActualOwner+".");
+	        }
+	        else{
+	        
+		        	content=new String("Nastąpiła zmiana na stanowisku Actual Owner. "+oldActualOwner+
+		        			" został zastąpiony przez "+newActualOwner+".");
+	        }
+	        Comment comment= new Comment(content, taskDto, initiator);
+	        return comment;
+		
+		
+	}
+}

Modified: incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/DaoTest.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/DaoTest.java?rev=967002&r1=967001&r2=967002&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/DaoTest.java (original)
+++ incubator/hise/trunk/hise-services/src/test/java/org/apache/hise/DaoTest.java Fri Jul
23 08:30:15 2010
@@ -1,9 +1,11 @@
 package org.apache.hise;
 
+import java.sql.Statement;
 import java.util.Date;
 import java.util.List;
 
 import org.apache.hise.TaskCreationHelper.TaskType;
+import org.apache.hise.dao.Comment;
 import org.apache.hise.dao.GenericHumanRole;
 import org.apache.hise.dao.HISEDao;
 import org.apache.hise.dao.Job;
@@ -87,6 +89,7 @@ public class DaoTest extends AbstractJUn
             }
         });
     }
+
     
     @Test
     public void testInputs() throws Exception {

Modified: incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml?rev=967002&r1=967001&r2=967002&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
(original)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/resources/META-INF/spring/beans.xml
Fri Jul 23 08:30:15 2010
@@ -57,6 +57,8 @@ xsi:schemaLocation="
               <property name="sender" ref="hiseJaxWSSender3"/>
             </bean>
             
+                        
+           
             <bean class="org.apache.hise.engine.store.TaskDD">
               <property name="taskName">
                 <bean class="javax.xml.namespace.QName" factory-method="valueOf">
@@ -80,6 +82,16 @@ xsi:schemaLocation="
             <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}Task6"></constructor-arg>
+                </bean>
+              </property>
+             <property name="handler" ref="hiseJaxWSService6"/>
+             <property name="sender" ref="hiseJaxWSSender6"/>
+            </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>
@@ -148,6 +160,7 @@ xsi:schemaLocation="
       </bean>
     </property>
   </bean>
+  
 
  <bean id="hiseJaxWSService7" class="org.apache.hise.engine.jaxws.HISEJaxWSService" init-method="init">
     <!--property name="id" value="hiseJaxWSService7"/-->
@@ -182,6 +195,23 @@ xsi:schemaLocation="
       </bean>
     </property>
   </bean>
+  
+  <bean id="hiseJaxWSService6" class="org.apache.hise.engine.jaxws.HISEJaxWSService" init-method="init">
+     <!--property name="id" value="hiseJaxWSService6"/-->
+    <property name="hiseEngine" ref="hiseEngine"/>
+    <property name="transactionManager" ref="transactionManager"></property>
+  </bean>
+ 
+  <jaxws:endpoint id="testHtd6" address="/ClaimsHandlingService6/" implementor="#hiseJaxWSService6"
serviceName="ins:ClaimsHandlingService" endpointName="ins:ClaimsHandlingPort" publish="true"
wsdlLocation="classpath:ExampleTasks.wsdl"/>
+
+  <bean id="hiseJaxWSSender6" class="org.apache.hise.engine.jaxws.HISEJaxWSClient" init-method="init">
+    <property name="wsdlDocumentLocation" value="classpath:ExampleTasks.wsdl"></property>
+    <property name="serviceName">
+     <bean class="javax.xml.namespace.QName" factory-method="valueOf">
+       <constructor-arg type="java.lang.String" value="{http://www.insurance.example.com/claims}ClaimsResolvingService"></constructor-arg>
+      </bean>
+    </property>
+  </bean>
 
 </beans>    
 

Modified: incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml?rev=967002&r1=967001&r2=967002&view=diff
==============================================================================
--- incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml (original)
+++ incubator/hise/trunk/hise-test-example-osgi/src/main/resources/testHtd1.xml Fri Jul 23
08:30:15 2010
@@ -10,7 +10,7 @@ Business Machines Corporation, Oracle In
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:tns="http://www.insurance.example.com/claims"
     targetNamespace="http://www.insurance.example.com/claims"
-    xsi:schemaLocation="http://www.example.org/WS-HT ws-humantask.xsd">
+    xsi:schemaLocation="http://www.example.org/WS-HT file:/usr/share/schemas/ws-humantask.xsd">
     
     <!-- 
         
@@ -49,6 +49,8 @@ Business Machines Corporation, Oracle In
                 htd:getInput("ClaimApprovalRequest")/cla:priority
             </htd:priority>
             
+
+            
             <htd:peopleAssignments>
             	<htd:potentialOwners>
                   <htd:from>
@@ -57,6 +59,7 @@ Business Machines Corporation, Oracle In
                             <htd:users>
                                 <htd:user>user1</htd:user>
                             </htd:users>
+                            
                         </htd:organizationalEntity>
                     </htd:literal>
                   </htd:from>
@@ -211,7 +214,7 @@ xs:double(htd:getInput("ClaimApprovalReq
   </htd:startDeadline>
     
     <htd:completionDeadline>
-      <htd:for>'PT6S'</htd:for>
+      <htd:for>'PT10S'</htd:for>
       <htd:escalation name="reassignTask3Completion">
         <htd:reassignment>
           <htd:potentialOwners>
@@ -229,6 +232,10 @@ xs:double(htd:getInput("ClaimApprovalReq
       </htd:escalation>
     </htd:completionDeadline>
   </htd:deadlines>
+  
+  
+  
+  
         </htd:task>    
         
         <!-- Two potential owners -->
@@ -481,6 +488,10 @@ xs:double(htd:getInput("ClaimApprovalReq
                 htd:getInput("ClaimApprovalRequest")/cla:priority
             </htd:priority>
             
+          <htd:savingTaskHistory>
+          		true
+          </htd:savingTaskHistory> 
+          
             <htd:peopleAssignments>
             	<htd:potentialOwners>
                   <htd:from>
@@ -708,7 +719,205 @@ xs:double(htd:getInput("ClaimApprovalReq
                 ]]>
             </htd:outcome>
         </htd:task>   
- 
+
+ <htd:task name="Task6">
+
+          <htd:documentation xml:lang="en-US">This task is used to handle claims that
require manual approval. </htd:documentation>
+            <htd:interface portType="tns:ClaimsHandlingPT" operation="approve" responsePortType="tns:ClaimsResolvingPT"
responseOperation="resolve"/>
+            <htd:priority> 
+                declare namespace cla="http://www.insurance.example.com/claims";
+               declare namespace htd="http://www.example.org/WS-HT";            
+                htd:getInput("ClaimApprovalRequest")/cla:priority
+            </htd:priority>
+            
+           <htd:savingTaskHistory>
+          		true
+          </htd:savingTaskHistory>    
+            
+            <htd:peopleAssignments>
+            	<htd:potentialOwners>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:users>
+                                <htd:user>user1</htd:user>
+                            </htd:users>
+                            
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:potentialOwners>
+                
+                <htd:businessAdministrators>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:groups>
+                                <htd:group>group1</htd:group>
+                                <htd:group>group2</htd:group>
+                            </htd:groups>
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:businessAdministrators>
+
+                <htd:businessAdministrators>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:users>
+                                <htd:user>user1</htd:user>
+                                <htd:user>user2</htd:user>
+                            </htd:users>
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:businessAdministrators>
+                
+            	<htd:taskStakeholders>
+                  <htd:from>
+                    <htd:literal>
+                        <htd:organizationalEntity>
+                            <htd:users>
+                                <htd:user>user3</htd:user>
+                            </htd:users>
+                        </htd:organizationalEntity>
+                    </htd:literal>
+                  </htd:from>
+                </htd:taskStakeholders>                
+            </htd:peopleAssignments>
+            
+            <htd:delegation potentialDelegatees="nobody"/>
+            
+            <htd:presentationElements>
+                
+                <htd:name xml:lang="en-US"> Approve Claim </htd:name>
+                
+                <htd:presentationParameters>
+                    
+                    <htd:presentationParameter name="firstname" type="xsd:string">
+declare namespace cla="http://www.insurance.example.com/claims";
+declare namespace htd="http://www.example.org/WS-HT";
+xs:string(htd:getInput("ClaimApprovalRequest")/cla:cust/cla:firstname)
+</htd:presentationParameter>
+                    
+                    <htd:presentationParameter name="lastname" type="xsd:string">
+declare namespace cla="http://www.insurance.example.com/claims";
+declare namespace htd="http://www.example.org/WS-HT";
+xs:string(htd:getInput("ClaimApprovalRequest")/cla:cust/cla:lastname)
+</htd:presentationParameter>
+                    
+                    <htd:presentationParameter name="euroAmount" type="xsd:double">
+declare namespace cla="http://www.insurance.example.com/claims";
+declare namespace htd="http://www.example.org/WS-HT";
+xs:double(htd:getInput("ClaimApprovalRequest")/cla:amount)
+</htd:presentationParameter>
+                        
+                </htd:presentationParameters>
+                
+<htd:subject xml:lang="en-US"> Approve the insurance claim for PLN {$euroAmount} on
behalf of {$firstname} {$lastname} </htd:subject>
+
+                <htd:description xml:lang="en-US" contentType="text/plain"> Approve
this claim following corporate guideline #4711.0815/7 for {$firstname} {$lastname} </htd:description>
+
+            </htd:presentationElements>
+            
+            <htd:outcome>
+                <![CDATA[
+                  <cla:resolve xmlns:cla="http://www.insurance.example.com/claims" xmlns:htd="http://www.example.org/WS-HT">
+                     <claimId>{htd:getInput("ClaimApprovalRequest")/cla:cust/cla:id/text()}</claimId>
+                     <ok>{$outcome}</ok>
+                  </cla:resolve>
+                ]]>
+            </htd:outcome>
+            
+            
+            
+               <htd:renderings>
+                <htd:rendering type="NSW/GWT">
+                <expression>
+                    <![CDATA[
+                   
+                        declare namespace htd="http://www.example.org/WS-HT"; 
+                                      
+                        <example name="anyname" xmlns:cla="http://www.insurance.example.com/claims">
+                            <param name="type" value="{htd:getInput("ClaimApprovalRequest")/cla:cust/cla:firstname/text()}"/>
+                        </example>
+            
+                    ]]>
+                    </expression>
+                </htd:rendering>
+              <htd:rendering type="simpleText">
+                <expression>
+                    <![CDATA[
+                      "test_expression"
+                    ]]>
+                    </expression>
+                </htd:rendering>
+			-
+   </htd:renderings>      
+            
+  <htd:deadlines>
+    <htd:startDeadline>
+      <htd:for>'PT5S'</htd:for>
+      <htd:escalation name="reassignTask3">
+        <htd:reassignment>
+          <htd:potentialOwners>
+            <htd:from>
+              <htd:literal>
+                <htd:organizationalEntity>
+                  <htd:users>
+                    <htd:user>user3</htd:user>
+                  </htd:users>
+                </htd:organizationalEntity>
+
+              </htd:literal>
+            </htd:from>
+          </htd:potentialOwners>
+        </htd:reassignment>
+      </htd:escalation>
+      
+    </htd:startDeadline>
+
+  <htd:startDeadline>
+    <htd:for>'PT5S'</htd:for>
+    <htd:escalation name="startDeadline2">
+      <htd:toParts>
+        <htd:toPart name="request">
+        <![CDATA[
+          <cla:notify xmlns:cla="http://www.insurance.example.com/claims" xmlns:htd="http://www.example.org/WS-HT">
+            <firstname>{htd:getInput("ClaimApprovalRequest")/cla:cust/cla:firstname/text()}</firstname>
+            <lastname>{htd:getInput("ClaimApprovalRequest")/cla:cust/cla:lastname/text()}</lastname>
+            <taskId>{$taskId}</taskId>
+          </cla:notify>
+        ]]>
+        </htd:toPart>
+      </htd:toParts>
+      <htd:localNotification reference="tns:Notify2"/>
+    </htd:escalation>
+  </htd:startDeadline>
+    
+    <htd:completionDeadline>
+      <htd:for>'PT10S'</htd:for>
+      <htd:escalation name="reassignTask3Completion">
+        <htd:reassignment>
+          <htd:potentialOwners>
+            <htd:from>
+              <htd:literal>
+                <htd:organizationalEntity>
+                  <htd:users>
+                    <htd:user>user4</htd:user>
+                  </htd:users>
+                </htd:organizationalEntity>
+              </htd:literal>
+            </htd:from>
+          </htd:potentialOwners>
+        </htd:reassignment>
+      </htd:escalation>
+    </htd:completionDeadline>
+  </htd:deadlines>
+  
+      
+        </htd:task>   
  
  		<htd:task name="Task7">
             

Modified: incubator/hise/trunk/hise-wsdl/src/main/resources/ws-humantask.xsd
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-wsdl/src/main/resources/ws-humantask.xsd?rev=967002&r1=967001&r2=967002&view=diff
==============================================================================
--- incubator/hise/trunk/hise-wsdl/src/main/resources/ws-humantask.xsd (original)
+++ incubator/hise/trunk/hise-wsdl/src/main/resources/ws-humantask.xsd Fri Jul 23 08:30:15
2010
@@ -192,27 +192,26 @@ Business Machines Corporation, Oracle In
   <xsd:complexContent>
     <xsd:extension base="tExtensibleElements">
       <xsd:sequence>
-        <xsd:element name="interface" type="tTaskInterface" />
-        <xsd:element ref="priority" minOccurs="0" />
-        <xsd:element ref="peopleAssignments" />
-        <xsd:element name="delegation" type="tDelegation"
-          minOccurs="0" />
-        <xsd:element name="presentationElements"
-          type="tPresentationElements" />
-        <xsd:element name="outcome" type="tQuery" minOccurs="0" />
-        <xsd:element name="searchBy" type="tExpression"
-          minOccurs="0" />
-        <xsd:element name="renderings" type="tRenderings"
-          minOccurs="0" />
-        <xsd:element name="deadlines" type="tDeadlines"
-          minOccurs="0" />
+      	<xsd:element name="interface" type="tTaskInterface" />
+      	<xsd:element ref="priority" minOccurs="0" />
+      	<xsd:element ref="peopleAssignments" />
+      	<xsd:element name="delegation" type="tDelegation"
+      		minOccurs="0" />
+      	<xsd:element name="presentationElements"
+      		type="tPresentationElements" />
+      	<xsd:element name="outcome" type="tQuery" minOccurs="0" />
+      	<xsd:element name="searchBy" type="tExpression" minOccurs="0" />
+      	<xsd:element name="renderings" type="tRenderings"
+      		minOccurs="0" />
+      	<xsd:element name="deadlines" type="tDeadlines" minOccurs="0" />
+      	<xsd:element name="savingTaskHistory" type="xsd:boolean" minOccurs="0" maxOccurs="1"
default="false"/>
       </xsd:sequence>
       <xsd:attribute name="name" type="xsd:NCName" use="required" />
     </xsd:extension>
   </xsd:complexContent>
 </xsd:complexType>
-<xsd:element name="priority" type="tPriority" />
-<xsd:complexType name="tTaskInterface">
+	<xsd:element name="priority" type="tPriority" />
+	<xsd:complexType name="tTaskInterface">
   <xsd:complexContent>
     <xsd:extension base="tExtensibleElements">
       <xsd:attribute name="portType" type="xsd:QName"
@@ -538,4 +537,8 @@ Business Machines Corporation, Oracle In
       <xsd:enumeration value="no" />
     </xsd:restriction>
   </xsd:simpleType>
+
+
+
+
 </xsd:schema>



Mime
View raw message