[jboss-svn-commits] JBL Code SVN: r23031 - in labs/jbossrules/trunk/drools-process: drools-process-task/src/main/java/org/drools/task and 9 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Sep 23 20:21:46 EDT 2008


Author: mark.proctor at jboss.com
Date: 2008-09-23 20:21:45 -0400 (Tue, 23 Sep 2008)
New Revision: 23031

Added:
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/AllowedToDelegate.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Allowed.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Operation.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/OperationCommand.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskError.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskOperation.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/org/drools/task/service/operations-dsl.mvel
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/AbstractBlockingResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteAttachmentResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteCommentResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingTaskOperationResponseHandler.java
Removed:
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Allowed.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/TaskOperation.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.process.email.conf
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/sun-jaxb.episode
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api-wsdl.xsd
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api.xsd
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.wsdl
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.xsd
Modified:
   labs/jbossrules/trunk/drools-process/drools-process-task/.classpath
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Deadline.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Delegation.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Status.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/BaseMinaHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/CommandName.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/DefaultEscalatedDeadlineHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/MinaTaskClient.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/SendIcal.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskClientHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServerHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskService.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServiceSession.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.email.conf
   labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/orm.xml
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/BaseTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/ModelPersistenceTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/QueryTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddAttachmentResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddCommentResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddTaskResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingEventResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetContentResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetTaskResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingSetContentResponseHandler.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/DemoTaskService.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/IcalTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/MockEventMessagingTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceCommentsAndAttachmentsTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceDeadlinesTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEscalationTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEventMessagingTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceLifeCycleTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceTest.java
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/FullyPopulatedTask.mvel
   labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/QueryData_UnescalatedDeadlines.mvel
   labs/jbossrules/trunk/drools-process/drools-workitems/.classpath
   labs/jbossrules/trunk/drools-process/drools-workitems/src/main/resources/META-INF/drools.email.conf
Log:
JBRULES-1745 WS-Human-Task
-DSL is now fully integrated and operation
-All client/server calls have response handlers
-Better error handling was added to task operations.

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/.classpath	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/.classpath	2008-09-24 00:21:45 UTC (rev 23031)
@@ -13,12 +13,9 @@
   <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.2/slf4j-api-1.5.2.jar"/>
   <classpathentry kind="src" path="/drools-workitems"/>
   <classpathentry kind="src" path="/drools-core"/>
-  <classpathentry kind="var" path="M2_REPO/org/mvel/mvel/2.0-SNAPSHOT/mvel-2.0-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/mvel/mvel/2.0M2/mvel-2.0M2.jar"/>
   <classpathentry kind="src" path="/drools-compiler"/>
   <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.0.1/antlr-runtime-3.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/antlr/gunit/1.0.1/gunit-1.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0.1/antlr-3.0.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.3.v_686_R32x/core-3.2.3.v_686_R32x.jar"/>
   <classpathentry kind="var" path="M2_REPO/janino/janino/2.5.10/janino-2.5.10.jar"/>
   <classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"/>
@@ -33,6 +30,7 @@
   <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-core/3.3.0.SP1/hibernate-core-3.3.0.SP1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/2.0.2/xml-apis-2.0.2.jar"/>

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Allowed.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Allowed.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Allowed.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,8 +0,0 @@
-/**
- * 
- */
-package org.drools.task;
-
-public enum Allowed {
-    Anybody, Nobody, PotentialOwners, Other;
-}
\ No newline at end of file

Copied: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/AllowedToDelegate.java (from rev 22857, labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Allowed.java)
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/AllowedToDelegate.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/AllowedToDelegate.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,8 @@
+/**
+ * 
+ */
+package org.drools.task;
+
+public enum AllowedToDelegate {
+    Anybody, Nobody, PotentialOwners, Other;
+}
\ No newline at end of file


Property changes on: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/AllowedToDelegate.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Deadline.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Deadline.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Deadline.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -48,6 +48,8 @@
         }
         CollectionUtils.writeI18NTextList( documentation, out );
         CollectionUtils.writeEscalationList( escalations, out );
+        
+        out.writeBoolean( escalated );
     }
     
     public void readExternal(ObjectInput in) throws IOException,
@@ -58,7 +60,9 @@
             date = new Date( in.readLong() );
         }
         documentation = CollectionUtils.readI18NTextList( in );
-        escalations = CollectionUtils.readEscalationList( in );       
+        escalations = CollectionUtils.readEscalationList( in );   
+        
+        escalated = in.readBoolean();
     }
 
     public long getId() {

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Delegation.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Delegation.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Delegation.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -23,16 +23,16 @@
 @Embeddable
 public class Delegation  implements Externalizable {
     @Enumerated(EnumType.STRING)      
-    private Allowed                    allowed;
+    private AllowedToDelegate                    allowedToDelegate;
     
     @ManyToMany
     @JoinTable(name = "Delegation_delegates", joinColumns = @JoinColumn(name = "task_id"), inverseJoinColumns = @JoinColumn(name = "entity_id"))    
     private List<OrganizationalEntity> delegates = Collections.emptyList();
     
     public void writeExternal(ObjectOutput out) throws IOException {
-        if ( allowed != null ) {
+        if ( allowedToDelegate != null ) {
             out.writeBoolean( true );
-            out.writeUTF( allowed.toString() );
+            out.writeUTF( allowedToDelegate.toString() );
         } else {
             out.writeBoolean( false );
         }
@@ -42,17 +42,17 @@
     public void readExternal(ObjectInput in) throws IOException,
                                             ClassNotFoundException {
         if ( in.readBoolean() ) {
-            allowed = Allowed.valueOf( in.readUTF() );
+            allowedToDelegate = AllowedToDelegate.valueOf( in.readUTF() );
         }
         delegates = CollectionUtils.readOrganizationalEntityList( in );
     }       
 
-    public Allowed getAllowed() {
-        return allowed;
+    public AllowedToDelegate getAllowed() {
+        return allowedToDelegate;
     }    
     
-    public void setAllowed(Allowed allowed) {
-        this.allowed = allowed;
+    public void setAllowed(AllowedToDelegate allowedToDelegate) {
+        this.allowedToDelegate = allowedToDelegate;
     }
 
     public List<OrganizationalEntity> getDelegates() {
@@ -70,7 +70,7 @@
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((allowed == null) ? 0 : allowed.hashCode());
+        result = prime * result + ((allowedToDelegate == null) ? 0 : allowedToDelegate.hashCode());
         result = prime * result + CollectionUtils.hashCode( delegates );
         return result;
     }
@@ -81,9 +81,9 @@
         if ( obj == null ) return false;
         if ( !(obj instanceof Delegation) ) return false;
         Delegation other = (Delegation) obj;
-        if ( allowed == null ) {
-            if ( other.allowed != null ) return false;
-        } else if ( !allowed.equals( other.allowed ) ) return false;
+        if ( allowedToDelegate == null ) {
+            if ( other.allowedToDelegate != null ) return false;
+        } else if ( !allowedToDelegate.equals( other.allowedToDelegate ) ) return false;
         
         return CollectionUtils.equals( delegates, other.delegates );
     }

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Status.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Status.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/Status.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,7 +1,6 @@
 package org.drools.task;
 
-import javax.persistence.Entity;
 
 public enum Status {
-    Created, Ready, Reserved, InProgress, Suspended, Completed, Failed, Error, Exited, Obselete;
+    Created, Ready, Reserved, InProgress, Suspended, Completed, Failed, Error, Exited, Obsolete;
 }

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/TaskOperation.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/TaskOperation.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/TaskOperation.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,29 +0,0 @@
-package org.drools.task;
-
-public class TaskOperation {
-    public void changeStatus(Task task, Status newStatus, User user) {
-        switch (newStatus) {
-            case Reserved : {
-                // must be business admin/potential owner
-                // claim, stop
-                break;
-            }
-            case InProgress : {
-                // must be actual owner
-                // start
-            }
-            case Ready : {
-                // must be business admin/potential owner
-                // release
-                break;
-            }
-            case Suspended : {
-                break;
-            }
-            case Completed : {
-                break;
-            }
-        }
-    }
-   
-}

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Allowed.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Allowed.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Allowed.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,8 @@
+package org.drools.task.service;
+
+public enum Allowed {
+    Owner,
+    Initiator,
+    PotentialOwner,
+    BusinessAdministrator;
+}

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/BaseMinaHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/BaseMinaHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/BaseMinaHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -24,6 +24,6 @@
     }
     
     public static interface ResponseHandler {
-        
+        public void setError(String error);
     }
 }
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/CommandName.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/CommandName.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/CommandName.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -2,22 +2,39 @@
 
 
 public enum CommandName {   
+    OperationRequest,
+    OperationResponse,
+    
     ClaimRequest,
     ClaimResponse,
+    
     StartRequest,
     StartResponse,
+    
     StopRequest,
     StopResponse,
+    
     ReleaseRequest,
-    ReleaseResponse,    
+    ReleaseResponse,  
+    
     SuspendRequest,
-    SuspendResponse,    
+    SuspendResponse, 
+    
     ResumeRequest,
-    ResumeResponse,    
+    ResumeResponse, 
+    
     SkipRequest,
-    SkipResponse,       
+    SkipResponse,  
+    
+    DelegateRequest,
+    DelegateResponse,
+    
+    ForwardRequest,
+    ForwardResponse,
+    
     CompleteRequest,
     CompleteResponse,   
+    
     FailRequest,
     FailResponse,
     
@@ -28,16 +45,17 @@
     AddTaskResponse,
     
     AddAttachmentRequest,
-    AddAttachmentResponse,
+    AddAttachmentResponse,    
     DeleteAttachmentRequest,
-    DeleteAttachmentResponse,    
+    DeleteAttachmentResponse,
+        
     SetDocumentContentRequest,
     SetDocumentContentResponse,
     GetContentRequest,
     GetContentResponse,
     
     AddCommentRequest,
-    AddCommentResponse,
+    AddCommentResponse,    
     DeleteCommentRequest,    
     DeleteCommentResponse,    
     

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/DefaultEscalatedDeadlineHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/DefaultEscalatedDeadlineHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/DefaultEscalatedDeadlineHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -50,17 +50,29 @@
 
     WorkItemManager      manager;
     
+    public DefaultEscalatedDeadlineHandler(Properties properties) {
+        handler = new EmailWorkItemHandler();
+        
+        String host = properties.getProperty( "mail.smtp.host", "localhost" );
+        String port = properties.getProperty( "mail.smtp.port", "25" );     
+        
+        from = properties.getProperty( "from", null );
+        replyTo = properties.getProperty( "replyTo", null );
+        
+        handler.setConnection( host, port, null, null );
+    }
+    
     public DefaultEscalatedDeadlineHandler() {
         handler = new EmailWorkItemHandler();
-        ChainedProperties conf = new ChainedProperties("process.email.conf");
-//        String host = conf.getProperty( "host", null );
-//        String port = conf.getProperty( "port", "25" );
-//        String userName = conf.getProperty( "userName", null );
-//        String password = conf.getProperty( "password", null );       
         
+        ChainedProperties conf = new ChainedProperties("drools.email.conf");
+        String host = conf.getProperty( "host", null );
+        String port = conf.getProperty( "port", "25" );
+        
         from = conf.getProperty( "from", null );
         replyTo = conf.getProperty( "replyTo", null );
         
+        handler.setConnection( host, port, null, null );
  
     }
     
@@ -88,14 +100,6 @@
         this.replyTo = replyTo;
     }
 
-    public EmailWorkItemHandler getHandler() {
-        return handler;
-    }
-
-    public void setHandler(EmailWorkItemHandler handler) {
-        this.handler = handler;
-    }
-
     public WorkItemManager getManager() {
         return manager;
     }
@@ -129,7 +133,6 @@
                 em.getTransaction().begin();
                 task.getTaskData().setStatus( Status.Ready );
                 List potentialOwners = new ArrayList( reassignment.getPotentialOwners() );
-                System.out.println( potentialOwners );
                 task.getPeopleAssignments().setPotentialOwners( potentialOwners );
                 em.getTransaction().commit();
             }            

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/MinaTaskClient.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/MinaTaskClient.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/MinaTaskClient.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -29,9 +29,12 @@
 import org.drools.task.service.TaskClientHandler.AddAttachmentResponseHandler;
 import org.drools.task.service.TaskClientHandler.AddCommentResponseHandler;
 import org.drools.task.service.TaskClientHandler.AddTaskResponseHandler;
+import org.drools.task.service.TaskClientHandler.DeleteAttachmentResponseHandler;
+import org.drools.task.service.TaskClientHandler.DeleteCommentResponseHandler;
 import org.drools.task.service.TaskClientHandler.GetContentResponseHandler;
 import org.drools.task.service.TaskClientHandler.GetTaskResponseHandler;
 import org.drools.task.service.TaskClientHandler.SetDocumentResponseHandler;
+import org.drools.task.service.TaskClientHandler.TaskOperationResponseHandler;
 import org.drools.task.service.TaskClientHandler.TaskSummaryResponseHandler;
 
 public class MinaTaskClient extends BaseMinaClient {
@@ -88,13 +91,17 @@
     }
 
     public void deleteComment(long taskId,
-                              long commentId) {
+                              long commentId,
+                              DeleteCommentResponseHandler responseHandler) {
         List args = new ArrayList( 2 );
         args.add( taskId );
         args.add( commentId );
         Command cmd = new Command( counter.getAndIncrement(),
                                    CommandName.DeleteCommentRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
@@ -119,7 +126,8 @@
 
     public void deleteAttachment(long taskId,
                                  long attachmentId,
-                                 long contentId) {
+                                 long contentId,
+                                 DeleteAttachmentResponseHandler responseHandler ) {
         List args = new ArrayList( 3 );
         args.add( taskId );
         args.add( attachmentId );
@@ -127,7 +135,10 @@
         Command cmd = new Command( counter.getAndIncrement(),
                                    CommandName.DeleteAttachmentRequest,
                                    args );
-
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
+        
         session.write( cmd );
     }
 
@@ -162,109 +173,201 @@
     }
 
     public void claim(long taskId,
-                      String userId) {
-        List args = new ArrayList( 1 );
+                      String userId,
+                      TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Claim );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.ClaimRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
 
     public void start(long taskId,
-                      String userId) {
-        List args = new ArrayList( 1 );
+                      String userId,
+                      TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Start );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.StartRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
 
     public void stop(long taskId,
-                     String userId) {
-        List args = new ArrayList( 1 );
+                     String userId,
+                     TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Stop );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.StopRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
 
     public void release(long taskId,
-                        String userId) {
-        List args = new ArrayList( 1 );
+                        String userId,
+                        TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Release );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.ReleaseRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
 
     public void suspend(long taskId,
-                        String userId) {
-        List args = new ArrayList( 1 );
+                        String userId,
+                        TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Suspend );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.SuspendRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
 
     public void resume(long taskId,
-                       String userId) {
-        List args = new ArrayList( 1 );
+                       String userId,
+                       TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Resume );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.ResumeRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
 
     public void skip(long taskId,
-                     String userId) {
-        List args = new ArrayList( 1 );
+                     String userId,
+                     TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Skip );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.SkipRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
+    
+    public void delegate(long taskId,
+                         String userId,
+                         String targetUserId,
+                         TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Delegate );
+        args.add( taskId );
+        args.add( userId );
+        args.add( targetUserId );
+        Command cmd = new Command( counter.getAndIncrement(),
+                                   CommandName.OperationRequest,
+                                   args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
+        session.write( cmd );      
+    }
+    
+    public void forward(long taskId,
+                        String userId,
+                        String targetEntityId,
+                        TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Forward );
+        args.add( taskId );
+        args.add( userId );
+        args.add( targetEntityId );
+        Command cmd = new Command( counter.getAndIncrement(),
+                                   CommandName.OperationRequest,
+                                   args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
+
+        session.write( cmd );      
+    }    
+
     public void complete(long taskId,
-                         String userId) {
-        List args = new ArrayList( 1 );
+                         String userId,
+                         TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Complete );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.CompleteRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }
 
     public void fail(long taskId,
-                     String userId) {
-        List args = new ArrayList( 1 );
+                     String userId,
+                     TaskOperationResponseHandler responseHandler) {
+        List args = new ArrayList( 4 );
+        args.add( Operation.Fail );
         args.add( taskId );
         args.add( userId );
+        args.add( null );
         Command cmd = new Command( counter.getAndIncrement(),
-                                   CommandName.FailRequest,
+                                   CommandName.OperationRequest,
                                    args );
+        
+        handler.addResponseHandler( cmd.getId(),
+                                    responseHandler );
 
         session.write( cmd );
     }

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Operation.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Operation.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/Operation.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,15 @@
+package org.drools.task.service;
+
+public enum Operation {
+    Claim,
+    Start,
+    Stop,
+    Release,
+    Suspend,
+    Resume,
+    Skip,
+    Delegate,
+    Forward,
+    Complete,
+    Fail;
+}

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/OperationCommand.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/OperationCommand.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/OperationCommand.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,94 @@
+package org.drools.task.service;
+
+import java.util.List;
+
+import org.drools.task.OrganizationalEntity;
+import org.drools.task.Status;
+import org.drools.task.User;
+
+public class OperationCommand {
+    private List<Status>        status;
+    private List<Status>        previousStatus;
+    private List<Allowed> allowed;
+    private Status        newStatus;
+    private boolean       setNewOwnerToTargetUser;
+    private boolean       setNewOwnerToNull;
+    private boolean       setToPreviousStatus;
+    private boolean       userIsExplicitPotentialOwner;
+    private boolean       addTargetUserToPotentialOwners;
+    private boolean       removeUserFromPotentialOwners;
+    private Operation     exec;
+    
+    public List<Status> getStatus() {
+        return status;
+    }
+    public void setStatus(List<Status> status) {
+        this.status = status;
+    }
+    public List<Status> getPreviousStatus() {
+        return previousStatus;
+    }
+    public void setPreviousStatus(List<Status> previousStatus) {
+        this.previousStatus = previousStatus;
+    }
+    public List<Allowed> getAllowed() {
+        return allowed;
+    }
+    public void setAllowed(List<Allowed> allowed) {
+        this.allowed = allowed;
+    }
+    public Status getNewStatus() {
+        return newStatus;
+    }        
+    
+    public boolean isSetNewOwnerToNull() {
+        return setNewOwnerToNull;
+    }
+    public void setSetNewOwnerToNull(boolean setNewOwnerToNull) {
+        this.setNewOwnerToNull = setNewOwnerToNull;
+    }
+    public boolean isAddTargetUserToPotentialOwners() {
+        return addTargetUserToPotentialOwners;
+    }
+    public void setNewStatus(Status newStatus) {
+        this.newStatus = newStatus;
+    }
+    public boolean isSetNewOwnerToTargetUser() {
+        return setNewOwnerToTargetUser;
+    }
+    public void setSetNewOwnerToTargetUser(boolean setNewOwnerToTargetUser) {
+        this.setNewOwnerToTargetUser = setNewOwnerToTargetUser;
+    }
+    public boolean isSetToPreviousStatus() {
+        return setToPreviousStatus;
+    }
+    public void setSetToPreviousStatus(boolean setToPreviousStatus) {
+        this.setToPreviousStatus = setToPreviousStatus;
+    }
+    public boolean isUserIsExplicitPotentialOwner() {
+        return userIsExplicitPotentialOwner;
+    }
+    public void setUserIsExplicitPotentialOwner(boolean userIsExplicitPotentialOwner) {
+        this.userIsExplicitPotentialOwner = userIsExplicitPotentialOwner;
+    }
+    public boolean isAddTargetEntityToPotentialOwners() {
+        return addTargetUserToPotentialOwners;
+    }
+    public void setAddTargetUserToPotentialOwners(boolean addTargetUserToPotentialOwners) {
+        this.addTargetUserToPotentialOwners = addTargetUserToPotentialOwners;
+    }
+    public boolean isRemoveUserFromPotentialOwners() {
+        return removeUserFromPotentialOwners;
+    }
+    public void setRemoveUserFromPotentialOwners(boolean removeUserFromPotentialOwners) {
+        this.removeUserFromPotentialOwners = removeUserFromPotentialOwners;
+    }
+    public Operation getExec() {
+        return exec;
+    }
+    public void setExec(Operation exec) {
+        this.exec = exec;
+    }
+    
+    
+}

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/SendIcal.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/SendIcal.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/SendIcal.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -46,42 +46,72 @@
 //import net.fortuna.ical4j.model.property.Version;
 
 public class SendIcal {
-    private static SimpleDateFormat df              = new SimpleDateFormat(  "yyyyMMdd'T'HHmmss'Z'" );
+    private static SimpleDateFormat df = new SimpleDateFormat( "yyyyMMdd'T'HHmmss'Z'" );
     static {
-        df.setTimeZone( TimeZone.getTimeZone("UTC") );
+        df.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
     }
 
     private Properties              connection;
     private String                  defaultLanguage;
-    
-    private static SendIcal instance = new SendIcal();
-    
+
+    private static SendIcal         instance;
+
+    public static void initInstance(Properties properties) {
+        if ( instance == null ) {
+            instance = new SendIcal( properties );
+        }
+    }
+
     public static SendIcal getInstance() {
+        if ( instance == null ) {
+            instance = new SendIcal();
+        }
         return instance;
     }
 
     SendIcal() {
-        ChainedProperties conf = new ChainedProperties( "process.email.conf" );
-        String host = conf.getProperty( "host",
-                                        null );
-        String port = conf.getProperty( "port",
+        ChainedProperties conf = new ChainedProperties( "drools.email.conf" );
+        String host = conf.getProperty( "mail.smtp.host",
+                                        "localhost" );
+        String port = conf.getProperty( "mail.smtp.port",
                                         "25" );
-        //        userName = conf.getProperty( "userName", null );
-        //        password = conf.getProperty( "password", null );   
-        
+
         connection = new Properties();
-        connection.setProperty("mail.transport.protocol", "smtp");
-        
+        connection.setProperty( "mail.transport.protocol",
+                                "smtp" );
+
         if ( host != null && host.trim().length() > 0 ) {
             connection.setProperty( "mail.smtp.host",
-                            host );
+                                    host );
         }
         if ( port != null && port.trim().length() > 0 ) {
             connection.setProperty( "mail.smtp.port",
                                     port );
         }
 
+        defaultLanguage = conf.getProperty( "defaultLanguage",
+                                            "en-UK" );
+    }
 
+    SendIcal(Properties conf) {
+        String host = conf.getProperty( "mail.smtp.host",
+                                        "localhost" );
+        String port = conf.getProperty( "mail.smtp.port",
+                                        "25" );
+
+        connection = new Properties();
+        connection.setProperty( "mail.transport.protocol",
+                                "smtp" );
+
+        if ( host != null && host.trim().length() > 0 ) {
+            connection.setProperty( "mail.smtp.host",
+                                    host );
+        }
+        if ( port != null && port.trim().length() > 0 ) {
+            connection.setProperty( "mail.smtp.port",
+                                    port );
+        }
+
         defaultLanguage = conf.getProperty( "defaultLanguage",
                                             "en-UK" );
     }
@@ -92,7 +122,7 @@
         User owner = data.getActualOwner();
         User creator = data.getCreatedBy();
         Date createdOn = data.getCreatedOn();
-        
+
         if ( task.getDeadlines() == null ) {
             return;
         }
@@ -128,18 +158,38 @@
         // send ical for start
         if ( start != null ) {
             try {
-                sendIcal(task.getId(), name, summary, description, task.getPriority(), start.getDate(), owner, creator, createdOn, userInfo, "Start");
+                sendIcal( task.getId(),
+                          name,
+                          summary,
+                          description,
+                          task.getPriority(),
+                          start.getDate(),
+                          owner,
+                          creator,
+                          createdOn,
+                          userInfo,
+                          "Start" );
             } catch ( Exception e ) {
-                
+
             }
         }
-        
+
         // send ical for end
         if ( end != null ) {
             try {
-                sendIcal(task.getId(), name, summary, description, task.getPriority(), end.getDate(), owner, creator, createdOn, userInfo, "End");
+                sendIcal( task.getId(),
+                          name,
+                          summary,
+                          description,
+                          task.getPriority(),
+                          end.getDate(),
+                          owner,
+                          creator,
+                          createdOn,
+                          userInfo,
+                          "End" );
             } catch ( Exception e ) {
-                
+
             }
         }
     }
@@ -149,10 +199,10 @@
                          String summary,
                          String description,
                          int priority,
-                         Date startDate,                       
+                         Date startDate,
                          User owner,
                          User creator,
-                         Date createdOn,    
+                         Date createdOn,
                          UserInfo userInfo,
                          String type) throws Exception {
         MimetypesFileTypeMap mimetypes = (MimetypesFileTypeMap) MimetypesFileTypeMap.getDefaultFileTypeMap();
@@ -193,7 +243,7 @@
 
         // Add ical
         messageBodyPart = new MimeBodyPart();
-        String filename = "ical-" + type + "-"+ taskId + ".ics";
+        String filename = "ical-" + type + "-" + taskId + ".ics";
         messageBodyPart.setFileName( filename );
         messageBodyPart.setHeader( "Content-Class",
                                    "urn:content-classes:calendarmessage" );
@@ -206,7 +256,7 @@
                                   userInfo.getDisplayName( creator ),
                                   creatorEmail,
                                   type );
-        
+
         messageBodyPart.setDataHandler( new DataHandler( new ByteArrayDataSource( icalStr,
                                                                                   "text/calendar; charset=UTF8; " ) ) );
         multipart.addBodyPart( messageBodyPart );

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskClientHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskClientHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskClientHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -14,8 +14,7 @@
 import org.drools.task.query.TaskSummary;
 
 public class TaskClientHandler extends BaseMinaHandler {
-    private MinaTaskClient    client;
-  
+    private MinaTaskClient client;
 
     public MinaTaskClient getClient() {
         return client;
@@ -36,11 +35,26 @@
                                 Object message) throws Exception {
         Command cmd = (Command) message;
         switch ( cmd.getName() ) {
+            case OperationResponse : {
+                TaskOperationResponseHandler responseHandler = (TaskOperationResponseHandler) responseHandlers.remove( cmd.getId() );
+                if ( responseHandler != null ) {
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.setIsDone( true );
+                    }
+                }
+                break;
+            }
             case GetTaskResponse : {
                 Task task = (Task) cmd.getArguments().get( 0 );
                 GetTaskResponseHandler responseHandler = (GetTaskResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( task );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( task );
+                    }
                 }
                 break;
             }
@@ -48,7 +62,11 @@
                 long taskId = (Long) cmd.getArguments().get( 0 );
                 AddTaskResponseHandler responseHandler = (AddTaskResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( taskId );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( taskId );
+                    }
                 }
                 break;
             }
@@ -56,25 +74,59 @@
                 long commentId = (Long) cmd.getArguments().get( 0 );
                 AddCommentResponseHandler responseHandler = (AddCommentResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( commentId );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( commentId );
+                    }
                 }
                 break;
             }
+            case DeleteCommentResponse : {
+                DeleteCommentResponseHandler responseHandler = (DeleteCommentResponseHandler) responseHandlers.remove( cmd.getId() );
+                if ( responseHandler != null ) {
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.setIsDone( true );
+                    }
+                }
+                break;                
+            }
             case AddAttachmentResponse : {
                 long attachmentId = (Long) cmd.getArguments().get( 0 );
                 long contentId = (Long) cmd.getArguments().get( 1 );
                 AddAttachmentResponseHandler responseHandler = (AddAttachmentResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( attachmentId,
-                                             contentId );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( attachmentId,
+                                                 contentId );
+                    }
                 }
                 break;
             }
+            case DeleteAttachmentResponse : {
+                DeleteAttachmentResponseHandler responseHandler = (DeleteAttachmentResponseHandler) responseHandlers.remove( cmd.getId() );
+                if ( responseHandler != null ) {
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.setIsDone( true );
+                    }
+                }
+                break;                
+            }            
             case GetContentResponse : {
                 Content content = (Content) cmd.getArguments().get( 0 );
                 GetContentResponseHandler responseHandler = (GetContentResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( content );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( content );
+                    }
                 }
                 break;
             }
@@ -82,7 +134,11 @@
                 long contentId = (Long) cmd.getArguments().get( 0 );
                 SetDocumentResponseHandler responseHandler = (SetDocumentResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( contentId );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( contentId );
+                    }
                 }
                 break;
             }
@@ -90,7 +146,11 @@
                 List<TaskSummary> results = (List<TaskSummary>) cmd.getArguments().get( 0 );
                 TaskSummaryResponseHandler responseHandler = (TaskSummaryResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( results );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( results );
+                    }
                 }
                 break;
             }
@@ -98,13 +158,17 @@
                 Payload payload = (Payload) cmd.getArguments().get( 0 );
                 EventResponseHandler responseHandler = (EventResponseHandler) responseHandlers.remove( cmd.getId() );
                 if ( responseHandler != null ) {
-                    responseHandler.execute( payload );
+                    if ( !cmd.getArguments().isEmpty() &&  cmd.getArguments().get( 0 ) instanceof TaskError ) {
+                        responseHandler.setError( ((TaskError) cmd.getArguments().get( 0 )).getMessage() );
+                    } else {
+                        responseHandler.execute( payload );
+                    }
                 }
-                break;                 
+                break;
             }
             default : {
-                
-            }            
+
+            }
         }
     }
 
@@ -120,12 +184,24 @@
         public void execute(long taskId);
     }
 
+    public static interface TaskOperationResponseHandler
+        extends
+        ResponseHandler {
+        public void setIsDone(boolean done);
+    }
+
     public static interface AddCommentResponseHandler
         extends
         ResponseHandler {
         public void execute(long commentId);
     }
 
+    public static interface DeleteCommentResponseHandler
+        extends
+        ResponseHandler {
+        public void setIsDone(boolean done);
+    }
+
     public static interface AddAttachmentResponseHandler
         extends
         ResponseHandler {
@@ -133,6 +209,12 @@
                             long contentId);
     }
 
+    public static interface DeleteAttachmentResponseHandler
+        extends
+        ResponseHandler {
+        public void setIsDone(boolean done);
+    }
+
     public static interface SetDocumentResponseHandler
         extends
         ResponseHandler {

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskError.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskError.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskError.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,44 @@
+/**
+ * 
+ */
+package org.drools.task.service;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+public class TaskError
+    implements
+    Externalizable {
+    String msg;
+
+    public TaskError() {
+        
+    }
+    
+    public TaskError(String msg) {
+        this.msg = msg;
+    }
+
+    public void writeExternal(ObjectOutput out) throws IOException {
+        if ( msg != null ) {
+            out.writeBoolean( true );
+            out.writeUTF( msg );
+        } else {
+            out.writeBoolean( false );
+        }
+    }
+
+    public void readExternal(ObjectInput in) throws IOException,
+                                            ClassNotFoundException {
+        if ( in.readBoolean() ) {
+            msg = in.readUTF();
+        }
+
+    }
+
+    public String getMessage() {
+        return msg;
+    }
+}
\ No newline at end of file

Copied: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskOperation.java (from rev 22980, labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/TaskOperation.java)
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskOperation.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskOperation.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,9 @@
+package org.drools.task.service;
+
+import org.drools.task.Status;
+import org.drools.task.Task;
+import org.drools.task.User;
+
+public enum TaskOperation {
+
+}


Property changes on: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskOperation.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServerHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServerHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServerHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -3,6 +3,7 @@
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -41,72 +42,39 @@
                                 Object message) throws Exception {
         Command cmd = (Command) message;
         TaskServiceSession taskSession = service.createSession();
+        TaskError error = null;
+        CommandName response = null;
         try {
             switch ( cmd.getName() ) {
-                case ClaimRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.claim( taskId,
-                                       userId );
+                case OperationRequest : {
+                    response = CommandName.OperationResponse;
+                    Operation operation = (Operation) cmd.getArguments().get( 0 );
+                    long taskId = (Long) cmd.getArguments().get( 1 );
+                    String userId = (String) cmd.getArguments().get( 2 );
+                    String targetEntityId = null;
+                    if ( cmd.getArguments().size() > 3 ) {
+                        targetEntityId = (String) cmd.getArguments().get( 3 );
+                    }
+                        error = taskSession.taskOperation( operation,
+                                                           taskId,
+                                                           userId,
+                                                           targetEntityId );
+                        List args = null;
+                        if ( error != null ) {
+                            args = new ArrayList( 1 );
+                            args.add( error );
+                        } else {
+                            args = Collections.emptyList();
+                        }
+
+                        Command resultsCmnd = new Command( cmd.getId(),
+                                                           CommandName.OperationResponse,
+                                                           args );
+                        session.write( resultsCmnd );
                     break;
                 }
-                case StartRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.start( taskId,
-                                       userId );
-                    break;
-                }
-                case StopRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.stop( taskId,
-                                      userId );
-                    break;
-                }
-                case ReleaseRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.release( taskId,
-                                         userId );
-                    break;
-                }
-                case SuspendRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.suspend( taskId,
-                                         userId );
-                    break;
-                }
-                case ResumeRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.resume( taskId,
-                                        userId );
-                    break;
-                }
-                case SkipRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.skip( taskId,
-                                      userId );
-                    break;
-                }
-                case CompleteRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.complete( taskId,
-                                          userId );
-                    break;
-                }
-                case FailRequest : {
-                    long taskId = (Long) cmd.getArguments().get( 0 );
-                    String userId = (String) cmd.getArguments().get( 1 );
-                    taskSession.fail( taskId,
-                                      userId );
-                    break;
-                }
                 case GetTaskRequest : {
+                    response = CommandName.GetTaskResponse;
                     long taskId = (Long) cmd.getArguments().get( 0 );
                     EntityManager em = service.getEntityManagerFactory().createEntityManager();
                     try {
@@ -123,6 +91,7 @@
                     break;
                 }
                 case AddTaskRequest : {
+                    response = CommandName.AddTaskResponse;
                     Task task = (Task) cmd.getArguments().get( 0 );
                     taskSession.addTask( task );
 
@@ -135,6 +104,7 @@
                     break;
                 }
                 case AddCommentRequest : {
+                    response = CommandName.AddCommentResponse;
                     Comment comment = (Comment) cmd.getArguments().get( 1 );
                     taskSession.addComment( (Long) cmd.getArguments().get( 0 ),
                                             comment );
@@ -148,13 +118,20 @@
                     break;
                 }
                 case DeleteCommentRequest : {
+                    response = CommandName.DeleteCommentResponse;
                     long taskId = (Long) cmd.getArguments().get( 0 );
                     long commentId = (Long) cmd.getArguments().get( 1 );
                     taskSession.deleteComment( taskId,
                                                commentId );
+
+                    Command resultsCmnd = new Command( cmd.getId(),
+                                                       CommandName.DeleteCommentResponse,
+                                                       Collections.emptyList() );
+                    session.write( resultsCmnd );
                     break;
                 }
                 case AddAttachmentRequest : {
+                    response = CommandName.AddAttachmentResponse;
                     Attachment attachment = (Attachment) cmd.getArguments().get( 1 );
                     Content content = (Content) cmd.getArguments().get( 2 );
                     taskSession.addAttachment( (Long) cmd.getArguments().get( 0 ),
@@ -171,15 +148,21 @@
                     break;
                 }
                 case DeleteAttachmentRequest : {
+                    response = CommandName.DeleteAttachmentResponse;
                     long taskId = (Long) cmd.getArguments().get( 0 );
                     long attachmentId = (Long) cmd.getArguments().get( 1 );
                     long contentId = (Long) cmd.getArguments().get( 2 );
                     taskSession.deleteAttachment( taskId,
                                                   attachmentId,
                                                   contentId );
+                    Command resultsCmnd = new Command( cmd.getId(),
+                                                       CommandName.DeleteAttachmentResponse,
+                                                       Collections.emptyList() );
+                    session.write( resultsCmnd );
                     break;
                 }
                 case SetDocumentContentRequest : {
+                    response = CommandName.SetDocumentContentResponse;
                     long taskId = (Long) cmd.getArguments().get( 0 );
                     Content content = (Content) cmd.getArguments().get( 1 );
                     taskSession.setDocumentContent( taskId,
@@ -194,6 +177,7 @@
                     break;
                 }
                 case GetContentRequest : {
+                    response = CommandName.GetContentResponse;
                     long contentId = (Long) cmd.getArguments().get( 0 );
                     Content content = taskSession.getContent( contentId );
                     List args = new ArrayList( 1 );
@@ -205,6 +189,7 @@
                     break;
                 }
                 case QueryTasksOwned : {
+                    response = CommandName.QueryTaskSummaryResponse;
                     List<TaskSummary> results = taskSession.getTasksOwned( (String) cmd.getArguments().get( 0 ),
                                                                            (String) cmd.getArguments().get( 1 ) );
                     List args = new ArrayList( 1 );
@@ -216,6 +201,7 @@
                     break;
                 }
                 case QueryTasksAssignedAsBusinessAdministrator : {
+                    response = CommandName.QueryTaskSummaryResponse;
                     List<TaskSummary> results = taskSession.getTasksAssignedAsBusinessAdministrator( (String) cmd.getArguments().get( 0 ),
                                                                                                      (String) cmd.getArguments().get( 1 ) );
                     List args = new ArrayList( 1 );
@@ -227,6 +213,7 @@
                     break;
                 }
                 case QueryTasksAssignedAsPotentialOwner : {
+                    response = CommandName.QueryTaskSummaryResponse;
                     List<TaskSummary> results = taskSession.getTasksAssignedAsPotentialOwner( (String) cmd.getArguments().get( 0 ),
                                                                                               (String) cmd.getArguments().get( 1 ) );
                     List args = new ArrayList( 1 );
@@ -238,6 +225,7 @@
                     break;
                 }
                 case QueryTasksAssignedAsTaskInitiator : {
+                    response = CommandName.QueryTaskSummaryResponse;
                     List<TaskSummary> results = taskSession.getTasksAssignedAsTaskInitiator( (String) cmd.getArguments().get( 0 ),
                                                                                              (String) cmd.getArguments().get( 1 ) );
                     List args = new ArrayList( 1 );
@@ -249,6 +237,7 @@
                     break;
                 }
                 case QueryTasksAssignedAsExcludedOwner : {
+                    response = CommandName.QueryTaskSummaryResponse;
                     List<TaskSummary> results = taskSession.getTasksAssignedAsExcludedOwner( (String) cmd.getArguments().get( 0 ),
                                                                                              (String) cmd.getArguments().get( 1 ) );
                     List args = new ArrayList( 1 );
@@ -260,6 +249,7 @@
                     break;
                 }
                 case QueryTasksAssignedAsRecipient : {
+                    response = CommandName.QueryTaskSummaryResponse;
                     List<TaskSummary> results = taskSession.getTasksAssignedAsRecipient( (String) cmd.getArguments().get( 0 ),
                                                                                          (String) cmd.getArguments().get( 1 ) );
                     List args = new ArrayList( 1 );
@@ -271,6 +261,7 @@
                     break;
                 }
                 case QueryTasksAssignedAsTaskStakeholder : {
+                    response = CommandName.QueryTaskSummaryResponse;
                     List<TaskSummary> results = taskSession.getTasksAssignedAsTaskStakeholder( (String) cmd.getArguments().get( 0 ),
                                                                                                (String) cmd.getArguments().get( 1 ) );
                     List args = new ArrayList( 1 );
@@ -282,6 +273,7 @@
                     break;
                 }
                 case RegisterForEventRequest : {
+                    response = CommandName.EventTriggerResponse;
                     EventKey key = (EventKey) cmd.getArguments().get( 0 );
                     boolean remove = (Boolean) cmd.getArguments().get( 1 );
                     String uuid = (String) cmd.getArguments().get( 2 );
@@ -308,6 +300,13 @@
 
             Date date = new Date();
             System.out.println( "Message written : " + cmd.getName() + " : " + date );
+        } catch ( Exception  e) {
+            List list = new ArrayList( 1 );
+            list.add( error );
+            Command resultsCmnd = new Command( cmd.getId(),
+                                               response,
+                                               list );
+            session.write( resultsCmnd );
         } finally {
             taskSession.dispose();
         }

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskService.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskService.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskService.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,8 +1,11 @@
 package org.drools.task.service;
 
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.io.Reader;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -18,6 +21,9 @@
 import org.drools.task.event.TaskEventListener;
 import org.drools.task.event.TaskEventSupport;
 import org.drools.task.query.DeadlineSummary;
+import org.mvel.MVEL;
+import org.mvel.ParserContext;
+import org.mvel.compiler.ExpressionCompiler;
 
 public class TaskService {
     EntityManagerFactory             emf;
@@ -31,10 +37,19 @@
 
     private TaskEventSupport         eventSupport;
     private EventKeys                eventKeys;
+    
+    Map<Operation, List<OperationCommand>> operations;
 
     public TaskService(EntityManagerFactory emf) {
+        this(emf, null);
+    }
+    
+    public TaskService(EntityManagerFactory emf, EscalatedDeadlineHandler escalationHandler) {
         this.emf = emf;
         this.em = emf.createEntityManager();
+        if ( escalationHandler != null ) {
+            this.escalatedDeadlineHandler = escalationHandler;
+        }
 
         eventSupport = new TaskEventSupport();
         eventKeys = new EventKeys();
@@ -49,6 +64,17 @@
                                                  this ),
                       summary.getDate().getTime() - now );
         }
+        
+        Map vars = new HashMap();
+        
+        //Reader reader;
+        Reader reader = new InputStreamReader( getClass().getResourceAsStream( "operations-dsl.mvel" ) );
+        try {
+        operations  = (Map<Operation,  List<OperationCommand>>) eval( toString( reader ),
+                                                                      vars );        
+        } catch (IOException e) {
+            throw new RuntimeException( "Unable To initialise TaskService, could not load Operations DSL" );
+        }
     }
 
     public TaskServiceSession createSession() {
@@ -62,6 +88,10 @@
                             delay,
                             TimeUnit.MILLISECONDS );
     }
+    
+    public Map<Operation,  List<OperationCommand>> getOperations() {
+        return operations;
+    }
 
     public EventKeys getEventKeys() {
         return eventKeys;
@@ -126,12 +156,25 @@
         int charValue = 0;
         StringBuffer sb = new StringBuffer( 1024 );
         while ( (charValue = reader.read()) != -1 ) {
-            //result = result + (char) charValue;
             sb.append( (char) charValue );
         }
         return sb.toString();
     }
+    
+    public Object eval(String str,
+                       Map vars) {
+        ExpressionCompiler compiler = new ExpressionCompiler( str.trim() );
 
+        ParserContext context = new ParserContext();
+        context.addPackageImport( "org.drools.task" );
+        context.addPackageImport( "org.drools.task.service" );
+        context.addPackageImport( "org.drools.task.query" );
+        context.addPackageImport( "java.util" );
+
+        return MVEL.executeExpression( compiler.compile( context ),
+                                       vars );
+    }    
+
     public static class ScheduledTaskDeadline
         implements
         Callable {

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServiceSession.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServiceSession.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/java/org/drools/task/service/TaskServiceSession.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -7,6 +7,7 @@
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
@@ -134,302 +135,215 @@
         }
     }
 
-    public void claim(long taskId,
-                      String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
-
-        User user = em.find( User.class,
-                             userId );
-        em.getTransaction().begin();
-        claim(task, user);
-        em.getTransaction().commit();
-    }
-    
-    public void claim(Task task,
-                      User user) {
+    public TaskError evalCommand(Operation operation,
+                                          List<OperationCommand> commands,
+                                          Task task,
+                                          User user,
+                                          OrganizationalEntity targetEntity) {
+        PeopleAssignments people = task.getPeopleAssignments();
         TaskData taskData = task.getTaskData();
+        boolean operationAllowed = false;
+        boolean statusMatched = false;
+        for ( OperationCommand command : commands ) {
+            // first find out if we have a matching status
+            if ( command.getStatus() != null ) {
+                for ( Status status : command.getStatus() ) {
+                    if ( taskData.getStatus() == status ) {
+                        statusMatched = true;
 
-        //task must be in status Ready
-        if ( taskData.getStatus() == Status.Ready ) {
-            // check permissions
-            PeopleAssignments people = task.getPeopleAssignments();
-            if ( isAllowed( user,
-                            new List[]{people.getPotentialOwners(), people.getBusinessAdministrators()} ) ) {
-                // only potential owners and business admin can claim a task
-                taskData.setStatus( Status.Reserved );
-                taskData.setActualOwner( user );
+                        // next find out if the user can execute this operation                
+                        if ( !isAllowed( command,
+                                         task,
+                                         user,
+                                         targetEntity ) ) {
+                            return new TaskError( "User '" + user + "' does not have permissions to execution operation '" + operation + "' on task id " + task.getId() );
 
-                // Task was reserved so owner should get icals
-                SendIcal.getInstance().sendIcalForTask( task,
-                                                        service.getUserinfo() );
+                        }
 
-                // trigger event support
-                service.getEventSupport().fireTaskClaimed( task.getId(),
-                                                           task.getTaskData().getActualOwner().getId() );
-            } else {
-                // @TODO Error
+                        commands( command,
+                                  task,
+                                  user,
+                                  targetEntity );
+                        return null;
+                    }
+                }
             }
-        } else {
-            // @TODO Error
-        }
-    }    
 
-    public void start(long taskId,
-                      String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
+            if ( command.getPreviousStatus() != null ) {
+                for ( Status status : command.getPreviousStatus() ) {
+                    if ( taskData.getPreviousStatus() == status ) {
+                        statusMatched = true;
 
-        User user = em.find( User.class,
-                             userId );
+                        // next find out if the user can execute this operation                
+                        if ( !isAllowed( command,
+                                         task,
+                                         user,
+                                         targetEntity ) ) {
+                            return new TaskError( "User '" + user + "' does not have permissions to execution operation '" + operation + "' on task id " + task.getId() );
+                        }
 
-        TaskData taskData = task.getTaskData();
-
-        // Status must be Read or Reserved
-        if ( taskData.getStatus() == Status.Ready ) {
-            // if Ready must be potentialOwner
-            PeopleAssignments people = task.getPeopleAssignments();
-            if ( isAllowed( user,
-                            new List[]{people.getPotentialOwners()} ) ) {
-                em.getTransaction().begin();
-                taskData.setActualOwner( user );
-                taskData.setStatus( Status.InProgress );
-                em.getTransaction().commit();
-            } else {
-                // @TODO Error
+                        commands( command,
+                                  task,
+                                  user,
+                                  targetEntity );
+                        return null;
+                    }
+                }
             }
-        } else if ( taskData.getStatus() == Status.Reserved ) {
-            // if Reserved must be actual owner
-            if ( taskData.getActualOwner().getId().equals( user.getId() ) ) {
-                em.getTransaction().begin();
-                taskData.setStatus( Status.InProgress );
-                em.getTransaction().commit();
-            } else {
-                // @TODO Error
-            }
-        } else {
-            // @TODO Error
-            return;
         }
+        if ( !statusMatched ) {
+            return new TaskError( "User '" + user + "' was unable to execution operation '" + operation + "' on task id " + task.getId() + " due to no 'current status' matchines" );
+        }
+
+        return null;
     }
 
-    public void stop(long taskId,
-                     String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
-
-        User user = em.find( User.class,
-                             userId );
-
+    private boolean isAllowed(OperationCommand command,
+                              Task task,
+                              User user,
+                              OrganizationalEntity targetEntity) {
+        PeopleAssignments people = task.getPeopleAssignments();
         TaskData taskData = task.getTaskData();
 
-        PeopleAssignments people = task.getPeopleAssignments();
-        if ( taskData.getStatus() == Status.InProgress && (taskData.getActualOwner().getId().equals( user.getId() ) || isAllowed( user,
-                                                                                                                                  new List[]{people.getBusinessAdministrators()} )) ) {
-            // Status must be InProgress and actual owner, switch to Reserved
-            em.getTransaction().begin();
-            taskData.setStatus( Status.Reserved );
-            em.getTransaction().commit();
-        } else {
-            // @TODO Error
-            return;
+        boolean operationAllowed = false;
+        for ( Allowed allowed : command.getAllowed() ) {
+            if ( operationAllowed ) {
+                break;
+            }
+            switch ( allowed ) {
+                case Owner : {
+                    operationAllowed = (taskData.getActualOwner() != null && taskData.getActualOwner().getId() == user.getId());
+                    break;
+                }
+                case Initiator : {
+                    operationAllowed = (taskData.getCreatedBy() != null && taskData.getCreatedBy().getId() == user.getId());
+                    break;
+                }
+                case PotentialOwner : {
+                    operationAllowed = isAllowed( user,
+                                                  people.getPotentialOwners() );
+                    break;
+                }
+                case BusinessAdministrator : {
+                    operationAllowed = isAllowed( user,
+                                                  people.getBusinessAdministrators() );
+                    break;
+                }
+            }
         }
-    }
 
-    public void release(long taskId,
-                        String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
+        if ( operationAllowed && command.isUserIsExplicitPotentialOwner() ) {
+            // if user has rights to execute the command, make sure user is explicitely specified (not as a group)
+            operationAllowed = people.getPotentialOwners().contains( user );
+        }
 
-        User user = em.find( User.class,
-                             userId );
+        return operationAllowed;
+    }
 
+    private void commands(OperationCommand command,
+                          Task task,
+                          User user,
+                          OrganizationalEntity targetEntity) {
+        PeopleAssignments people = task.getPeopleAssignments();
         TaskData taskData = task.getTaskData();
 
-        // task must be reserved or in progress and owned by user
-        PeopleAssignments people = task.getPeopleAssignments();
-        if ( (taskData.getStatus() == Status.Reserved || taskData.getStatus() == Status.InProgress) && (taskData.getActualOwner().getId().equals( user.getId() ) || isAllowed( user,
-                                                                                                                                                                               new List[]{people.getBusinessAdministrators()} )) ) {
-            em.getTransaction().begin();
-            taskData.setStatus( Status.Ready );
-            taskData.setActualOwner( null );
-            em.getTransaction().commit();
-        } else {
-            //@TODO Error
+        if ( command.getNewStatus() != null ) {
+            taskData.setStatus( command.getNewStatus() );
+        } else if ( command.isSetToPreviousStatus() ) {
+            taskData.setStatus( taskData.getPreviousStatus() );
         }
-    }
 
-    public void suspend(long taskId,
-                        String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
+        if ( command.isAddTargetEntityToPotentialOwners() && !people.getPotentialOwners().contains( targetEntity ) ) {
+            people.getPotentialOwners().add( targetEntity );
+        }
 
-        User user = em.find( User.class,
-                             userId );
+        if ( command.isRemoveUserFromPotentialOwners() ) {
+            people.getPotentialOwners().remove( user );
+        }
 
-        TaskData taskData = task.getTaskData();
-
-        List[] allowed;
-        PeopleAssignments people = task.getPeopleAssignments();
-        if ( taskData.getStatus() == Status.Ready ) {
-            // If it's ready then potential owners can suspect too
-            allowed = new List[]{people.getPotentialOwners(), people.getBusinessAdministrators()};
-        } else {
-            allowed = new List[]{people.getBusinessAdministrators()};
+        if ( command.isSetNewOwnerToTargetUser() ) {
+            taskData.setActualOwner( (User) user );
         }
 
-        if ( (taskData.getStatus() == Status.Ready || taskData.getStatus() == Status.Reserved || taskData.getStatus() == Status.InProgress)
-             && ((taskData.getActualOwner() != null && taskData.getActualOwner().getId().equals( user.getId() )) || isAllowed( user,
-                                                                                                                               allowed )) ) {
-            em.getTransaction().begin();
-            taskData.setStatus( Status.Suspended );
-            em.getTransaction().commit();
-        } else {
-            //@TODO Error            
+        if ( command.isSetNewOwnerToNull() ) {
+            taskData.setActualOwner( null );
         }
-    }
 
-    public void resume(long taskId,
-                       String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
+        if ( command.getExec() != null ) {
+            switch ( command.getExec() ) {
+                case Claim : {
+                    taskData.setActualOwner( (User) targetEntity );
+                    // Task was reserved so owner should get icals
+                    SendIcal.getInstance().sendIcalForTask( task,
+                                                            service.getUserinfo() );
 
-        User user = em.find( User.class,
-                             userId );
-
-        TaskData taskData = task.getTaskData();
-
-        List[] allowed;
-        PeopleAssignments people = task.getPeopleAssignments();
-        if ( taskData.getPreviousStatus() == Status.Ready ) {
-            // If it's ready then potential owners can suspect too
-            allowed = new List[]{people.getPotentialOwners(), people.getBusinessAdministrators()};
-        } else {
-            allowed = new List[]{people.getBusinessAdministrators()};
+                    // trigger event support
+                    service.getEventSupport().fireTaskClaimed( task.getId(),
+                                                               task.getTaskData().getActualOwner().getId() );
+                    break;
+                }
+            }
         }
-
-        if ( (taskData.getStatus() == Status.Suspended) && ((taskData.getActualOwner() != null && taskData.getActualOwner().getId().equals( user.getId() )) || isAllowed( user,
-                                                                                                                                                                          allowed )) ) {
-            em.getTransaction().begin();
-            taskData.setStatus( taskData.getPreviousStatus() );
-            em.getTransaction().commit();
-        } else {
-            //@TODO Error            
-        }
     }
 
-    public void skip(long taskId,
-                     String userId) {
+    public TaskError taskOperation(Operation operation,
+                                            long taskId,
+                                            String userId,
+                                            String targetEntityId) {
         Task task = em.find( Task.class,
                              taskId );
 
         User user = em.find( User.class,
                              userId );
 
-        TaskData taskData = task.getTaskData();
-
-        List[] allowed;
-        PeopleAssignments people = task.getPeopleAssignments();
-        if ( taskData.getStatus() == Status.Ready ) {
-            // If it's ready then potential owners can skip too
-            allowed = new List[]{people.getPotentialOwners(), people.getBusinessAdministrators()};
-        } else {
-            allowed = new List[]{people.getBusinessAdministrators()};
+        OrganizationalEntity targetEntity = null;
+        if ( targetEntityId != null ) {
+            targetEntity = em.find( OrganizationalEntity.class,
+                                    targetEntityId );
         }
 
-        if ( task.getTaskData().isSkipable() && (taskData.getStatus() != Status.Completed && taskData.getStatus() != Status.Failed)
-             && ((taskData.getActualOwner() != null && taskData.getActualOwner().getId().equals( user.getId() )) || isAllowed( user,
-                                                                                                                               allowed )) ) {
-            em.getTransaction().begin();
-            taskData.setStatus( Status.Obselete );
-            em.getTransaction().commit();
-        } else {
-            //@TODO Error            
-        }
-    }
+        em.getTransaction().begin();
+        TaskError error = null;
+        try {
+            Map<Operation, List<OperationCommand>> dsl = service.getOperations();
+            List<OperationCommand> commands = dsl.get( operation );
+            error = evalCommand( operation,
+                                 commands,
+                                 task,
+                                 user,
+                                 targetEntity );
 
-    public void complete(long taskId,
-                         String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
+            if ( error != null ) {
+                throw new RuntimeException( "TaskOperationException" );
+            }
+            switch ( operation ) {
+                case Claim : {
+                    // Task was reserved so owner should get icals
+                    SendIcal.getInstance().sendIcalForTask( task,
+                                                            service.getUserinfo() );
+                    // trigger event support
+                    service.getEventSupport().fireTaskClaimed( task.getId(),
+                                                               task.getTaskData().getActualOwner().getId() );
+                    break;
+                }
+            }
 
-        User user = em.find( User.class,
-                             userId );
+        } catch ( Exception e ) {
+            em.getTransaction().rollback();
 
-        TaskData taskData = task.getTaskData();
-
-        if ( taskData.getStatus() == Status.InProgress && taskData.getActualOwner().getId().equals( user.getId() ) ) {
-            // Status must be InProgress and actual owner, switch to Reserved
             em.getTransaction().begin();
-            taskData.setStatus( Status.Completed );
+            task.getTaskData().setStatus( Status.Error );
             em.getTransaction().commit();
-        } else {
-            // @TODO Error
-            return;
-        }
-    }
 
-    public void delegate(long taskId,
-                         String delegateId,
-                         String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
-        TaskData taskData = task.getTaskData();
-        Delegation delegation = task.getDelegation();
-        
-        
-        User delegate = em.find( User.class,
-                                   delegateId );
-        
-        User user = em.find( User.class,
-                             userId );
-        
-        // check correct status
-        if ( taskData.getStatus() == Status.Ready || taskData.getStatus() == Status.Reserved || taskData.getStatus() == Status.InProgress ) {
-            // check valid user
-            PeopleAssignments people = task.getPeopleAssignments();
-            if ( taskData.getActualOwner().getId().equals( user.getId() ) || isAllowed( user,
-                            new List[]{people.getPotentialOwners(), people.getBusinessAdministrators()} ) ) {
-                // is valid delegate
-               if ( isAllowed( delegate, new List[] { delegation.getDelegates() } ) ) {
-                   em.getTransaction().begin();
-                   taskData.setStatus( Status.Ready );
-                   if ( people.getPotentialOwners().contains( delegate ) ) {
-                       // Add delegate to potentialOwners if it's not already
-                       people.getPotentialOwners().add( delegate );
-                   }
-                   claim(task, delegate);
-                   em.getTransaction().commit();
-               }
-            } else {
-                // @TODO ERROR
+            error = new TaskError( "User '" + user + "' was unable to execution operation '" + operation + "' on task id " + task.getId() + " due to exception:\n" + e.getMessage() );
+        } finally {
+            if ( em.getTransaction().isActive() ) {
+                em.getTransaction().commit();
             }
-        } else {
-            // @TODO ERROR
         }
+        return error;
     }
 
-    public void fail(long taskId,
-                     String userId) {
-        Task task = em.find( Task.class,
-                             taskId );
-
-        User user = em.find( User.class,
-                             userId );
-
-        TaskData taskData = task.getTaskData();
-
-        if ( taskData.getStatus() == Status.InProgress && taskData.getActualOwner().getId().equals( user.getId() ) ) {
-            // Status must be InProgress and actual owner, switch to Reserved
-            em.getTransaction().begin();
-            taskData.setStatus( Status.Failed );
-            em.getTransaction().commit();
-        } else {
-            // @TODO Error
-            return;
-        }
-    }
-
     public void addComment(long taskId,
                            Comment comment) {
         Task task = em.find( Task.class,

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.email.conf
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.email.conf	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.email.conf	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,8 +1,5 @@
 from = from at domain.com
 replyTo = replyTo at domain.com
-host = localhost
-#host = smtp.corp.redhat.com
-port = 2345
-defaultLanguage = en-UK
-#userName =
-#password =
\ No newline at end of file
+mail.smtp.host = localhost
+mail.smtp.port = 25
+defaultLanguage = en-UK
\ No newline at end of file

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.process.email.conf
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.process.email.conf	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/drools.process.email.conf	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,8 +0,0 @@
-from = from at domain.com
-replyTo = replyTo at domain.com
-host = localhost
-#host = smtp.corp.redhat.com
-port = 2345
-defaultLanguage = en-UK
-#userName =
-#password =
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/orm.xml
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/orm.xml	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/orm.xml	2008-09-24 00:21:45 UTC (rev 23031)
@@ -40,7 +40,7 @@
      
     t.taskData.expirationTime is null             
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>      
       <named-query name="TasksAssignedAsExcludedOwner">
           <query>
@@ -79,7 +79,7 @@
      
     t.taskData.expirationTime is null             
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>
       <named-query name="TasksAssignedAsPotentialOwner">
           <query>
@@ -118,7 +118,7 @@
      
     t.taskData.expirationTime is null              
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>
       <named-query name="TasksAssignedAsRecipient">
           <query>
@@ -157,7 +157,7 @@
      
     t.taskData.expirationTime is null              
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>
       <named-query name="TasksAssignedAsTaskInitiator">
           <query>
@@ -196,7 +196,7 @@
      
     t.taskData.expirationTime is null              
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>
       <named-query name="TasksAssignedAsTaskStakeholder">
           <query>
@@ -235,7 +235,7 @@
      
     t.taskData.expirationTime is null              
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>
       <named-query name="TasksOwned">
           <query>
@@ -268,7 +268,7 @@
     descriptions.language = :language and 
     t.taskData.expirationTime is null          
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>   
 	  <named-query name="UnescalatedDeadlines">
           <query>
@@ -286,6 +286,6 @@
 order by
     d.date              
           </query>
-          <hint name="org.hibernate.timeout" value="200"/>
+          <!-- hint name="org.hibernate.timeout" value="200"/ -->
       </named-query>  
 </entity-mappings>

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/sun-jaxb.episode
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/sun-jaxb.episode	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/META-INF/sun-jaxb.episode	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,405 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<bindings version="2.1" xmlns="http://java.sun.com/xml/ns/jaxb">
-  <!--
-
-This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520 
-See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-Any modifications to this file will be lost upon recompilation of the source schema. 
-Generated on: 2008.08.21 at 05:31:46 AM BST 
-
-  -->
-  <bindings scd="x-schema::tns" xmlns:tns="http://www.drools.org/WS-HT">
-    <schemaBindings map="false"/>
-    <bindings scd="~tns:tNotification">
-      <class ref="org.drools.ws_ht.TNotification"/>
-    </bindings>
-    <bindings scd="~tns:tNotifications">
-      <class ref="org.drools.ws_ht.TNotifications"/>
-    </bindings>
-    <bindings scd="~tns:tText">
-      <class ref="org.drools.ws_ht.TText"/>
-    </bindings>
-    <bindings scd="~tns:tArgument">
-      <class ref="org.drools.ws_ht.TArgument"/>
-    </bindings>
-    <bindings scd="~tns:tReassignment">
-      <class ref="org.drools.ws_ht.TReassignment"/>
-    </bindings>
-    <bindings scd="~tns:tExtension">
-      <class ref="org.drools.ws_ht.TExtension"/>
-    </bindings>
-    <bindings scd="~tns:tHumanInteractions">
-      <class ref="org.drools.ws_ht.THumanInteractions"/>
-    </bindings>
-    <bindings scd="~tns:tTaskInterface">
-      <class ref="org.drools.ws_ht.TTaskInterface"/>
-    </bindings>
-    <bindings scd="~tns:tToParts">
-      <class ref="org.drools.ws_ht.TToParts"/>
-    </bindings>
-    <bindings scd="~tns:tPresentationElements">
-      <class ref="org.drools.ws_ht.TPresentationElements"/>
-    </bindings>
-    <bindings scd="~tns:tDuration-expr">
-      <class ref="org.drools.ws_ht.TDurationExpr"/>
-    </bindings>
-    <bindings scd="~tns:tDeadlines">
-      <class ref="org.drools.ws_ht.TDeadlines"/>
-    </bindings>
-    <bindings scd="~tns:tDelegation">
-      <class ref="org.drools.ws_ht.TDelegation"/>
-    </bindings>
-    <bindings scd="~tns:tLogicalPeopleGroup">
-      <class ref="org.drools.ws_ht.TLogicalPeopleGroup"/>
-    </bindings>
-    <bindings scd="~tns:tExpression">
-      <class ref="org.drools.ws_ht.TExpression"/>
-    </bindings>
-    <bindings scd="~tns:tPresentationParameters">
-      <class ref="org.drools.ws_ht.TPresentationParameters"/>
-    </bindings>
-    <bindings scd="~tns:tRenderings">
-      <class ref="org.drools.ws_ht.TRenderings"/>
-    </bindings>
-    <bindings scd="~tns:tEscalation">
-      <class ref="org.drools.ws_ht.TEscalation"/>
-    </bindings>
-    <bindings scd="~tns:tDeadline">
-      <class ref="org.drools.ws_ht.TDeadline"/>
-    </bindings>
-    <bindings scd="~tns:tUserlist">
-      <class ref="org.drools.ws_ht.TUserlist"/>
-    </bindings>
-    <bindings scd="~tns:tPresentationParameter">
-      <class ref="org.drools.ws_ht.TPresentationParameter"/>
-    </bindings>
-    <bindings scd="~tns:tLocalNotification">
-      <class ref="org.drools.ws_ht.TLocalNotification"/>
-    </bindings>
-    <bindings scd="~tns:tTask">
-      <class ref="org.drools.ws_ht.TTask"/>
-    </bindings>
-    <bindings scd="~tns:tNotificationInterface">
-      <class ref="org.drools.ws_ht.TNotificationInterface"/>
-    </bindings>
-    <bindings scd="~tns:tGenericHumanRole">
-      <class ref="org.drools.ws_ht.TGenericHumanRole"/>
-    </bindings>
-    <bindings scd="~tns:tTasks">
-      <class ref="org.drools.ws_ht.TTasks"/>
-    </bindings>
-    <bindings scd="~tns:tFrom">
-      <class ref="org.drools.ws_ht.TFrom"/>
-    </bindings>
-    <bindings scd="~tns:tImport">
-      <class ref="org.drools.ws_ht.TImport"/>
-    </bindings>
-    <bindings scd="~tns:tExtensibleMixedContentElements">
-      <class ref="org.drools.ws_ht.TExtensibleMixedContentElements"/>
-    </bindings>
-    <bindings scd="~tns:tToPart">
-      <class ref="org.drools.ws_ht.TToPart"/>
-    </bindings>
-    <bindings scd="~tns:tDocumentation">
-      <class ref="org.drools.ws_ht.TDocumentation"/>
-    </bindings>
-    <bindings scd="~tns:tGrouplist">
-      <class ref="org.drools.ws_ht.TGrouplist"/>
-    </bindings>
-    <bindings scd="~tns:tLiteral">
-      <class ref="org.drools.ws_ht.TLiteral"/>
-    </bindings>
-    <bindings scd="~tns:tLogicalPeopleGroups">
-      <class ref="org.drools.ws_ht.TLogicalPeopleGroups"/>
-    </bindings>
-    <bindings scd="~tns:tPriority">
-      <class ref="org.drools.ws_ht.TPriority"/>
-    </bindings>
-    <bindings scd="~tns:tQuery">
-      <class ref="org.drools.ws_ht.TQuery"/>
-    </bindings>
-    <bindings scd="~tns:tRendering">
-      <class ref="org.drools.ws_ht.TRendering"/>
-    </bindings>
-    <bindings scd="~tns:tParameter">
-      <class ref="org.drools.ws_ht.TParameter"/>
-    </bindings>
-    <bindings scd="~tns:tPeopleAssignments">
-      <class ref="org.drools.ws_ht.TPeopleAssignments"/>
-    </bindings>
-    <bindings scd="~tns:tBoolean-expr">
-      <class ref="org.drools.ws_ht.TBooleanExpr"/>
-    </bindings>
-    <bindings scd="~tns:tDescription">
-      <class ref="org.drools.ws_ht.TDescription"/>
-    </bindings>
-    <bindings scd="~tns:tExtensions">
-      <class ref="org.drools.ws_ht.TExtensions"/>
-    </bindings>
-    <bindings scd="~tns:tExtensibleElements">
-      <class ref="org.drools.ws_ht.TExtensibleElements"/>
-    </bindings>
-    <bindings scd="~tns:tOrganizationalEntity">
-      <class ref="org.drools.ws_ht.TOrganizationalEntity"/>
-    </bindings>
-    <bindings scd="~tns:tDeadline-expr">
-      <class ref="org.drools.ws_ht.TDeadlineExpr"/>
-    </bindings>
-  </bindings>
-  <bindings scd="x-schema::tns" xmlns:tns="http://www.drools.org/WS-HT/api">
-    <schemaBindings map="false"/>
-    <bindings scd="~tns:tTask">
-      <class ref="org.drools.ws_ht.api.TTask"/>
-    </bindings>
-    <bindings scd="~tns:tTaskQueryResultRow">
-      <class ref="org.drools.ws_ht.api.TTaskQueryResultRow"/>
-    </bindings>
-    <bindings scd="~tns:tTaskQueryResultSet">
-      <class ref="org.drools.ws_ht.api.TTaskQueryResultSet"/>
-    </bindings>
-    <bindings scd="~tns:tComment">
-      <class ref="org.drools.ws_ht.api.TComment"/>
-    </bindings>
-    <bindings scd="~tns:tAttachmentInfo">
-      <class ref="org.drools.ws_ht.api.TAttachmentInfo"/>
-    </bindings>
-    <bindings scd="~tns:tAttachment">
-      <class ref="org.drools.ws_ht.api.TAttachment"/>
-    </bindings>
-    <bindings scd="~tns:tTaskAbstract">
-      <class ref="org.drools.ws_ht.api.TTaskAbstract"/>
-    </bindings>
-  </bindings>
-  <bindings scd="x-schema::tns" xmlns:tns="http://www.drools.org/WS-HT/api/xsd">
-    <schemaBindings map="false"/>
-    <bindings scd="tns:nominate">
-      <class ref="org.drools.ws_ht.api.xsd.Nominate"/>
-    </bindings>
-    <bindings scd="tns:getFault">
-      <class ref="org.drools.ws_ht.api.xsd.GetFault"/>
-    </bindings>
-    <bindings scd="tns:getTaskDescription">
-      <class ref="org.drools.ws_ht.api.xsd.GetTaskDescription"/>
-    </bindings>
-    <bindings scd="tns:getRenderingTypesResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetRenderingTypesResponse"/>
-    </bindings>
-    <bindings scd="tns:release">
-      <class ref="org.drools.ws_ht.api.xsd.Release"/>
-    </bindings>
-    <bindings scd="tns:getFaultResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetFaultResponse"/>
-    </bindings>
-    <bindings scd="tns:setPriority">
-      <class ref="org.drools.ws_ht.api.xsd.SetPriority"/>
-    </bindings>
-    <bindings scd="tns:setOutputResponse">
-      <class ref="org.drools.ws_ht.api.xsd.SetOutputResponse"/>
-    </bindings>
-    <bindings scd="tns:completeResponse">
-      <class ref="org.drools.ws_ht.api.xsd.CompleteResponse"/>
-    </bindings>
-    <bindings scd="tns:stop">
-      <class ref="org.drools.ws_ht.api.xsd.Stop"/>
-    </bindings>
-    <bindings scd="tns:suspendUntilResponse">
-      <class ref="org.drools.ws_ht.api.xsd.SuspendUntilResponse"/>
-    </bindings>
-    <bindings scd="tns:query">
-      <class ref="org.drools.ws_ht.api.xsd.Query"/>
-    </bindings>
-    <bindings scd="tns:fail">
-      <class ref="org.drools.ws_ht.api.xsd.Fail"/>
-    </bindings>
-    <bindings scd="tns:resume">
-      <class ref="org.drools.ws_ht.api.xsd.Resume"/>
-    </bindings>
-    <bindings scd="tns:getTaskInfoResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetTaskInfoResponse"/>
-    </bindings>
-    <bindings scd="tns:forward">
-      <class ref="org.drools.ws_ht.api.xsd.Forward"/>
-    </bindings>
-    <bindings scd="tns:complete">
-      <class ref="org.drools.ws_ht.api.xsd.Complete"/>
-    </bindings>
-    <bindings scd="tns:addAttachment">
-      <class ref="org.drools.ws_ht.api.xsd.AddAttachment"/>
-    </bindings>
-    <bindings scd="tns:getInput">
-      <class ref="org.drools.ws_ht.api.xsd.GetInput"/>
-    </bindings>
-    <bindings scd="tns:activate">
-      <class ref="org.drools.ws_ht.api.xsd.Activate"/>
-    </bindings>
-    <bindings scd="tns:suspend">
-      <class ref="org.drools.ws_ht.api.xsd.Suspend"/>
-    </bindings>
-    <bindings scd="tns:resumeResponse">
-      <class ref="org.drools.ws_ht.api.xsd.ResumeResponse"/>
-    </bindings>
-    <bindings scd="tns:remove">
-      <class ref="org.drools.ws_ht.api.xsd.Remove"/>
-    </bindings>
-    <bindings scd="tns:setOutput">
-      <class ref="org.drools.ws_ht.api.xsd.SetOutput"/>
-    </bindings>
-    <bindings scd="tns:getAttachmentInfos">
-      <class ref="org.drools.ws_ht.api.xsd.GetAttachmentInfos"/>
-    </bindings>
-    <bindings scd="tns:getTaskDescriptionResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetTaskDescriptionResponse"/>
-    </bindings>
-    <bindings scd="tns:getRenderingResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetRenderingResponse"/>
-    </bindings>
-    <bindings scd="tns:delegateResponse">
-      <class ref="org.drools.ws_ht.api.xsd.DelegateResponse"/>
-    </bindings>
-    <bindings scd="tns:queryResponse">
-      <class ref="org.drools.ws_ht.api.xsd.QueryResponse"/>
-    </bindings>
-    <bindings scd="tns:getOutput">
-      <class ref="org.drools.ws_ht.api.xsd.GetOutput"/>
-    </bindings>
-    <bindings scd="tns:getTaskInfo">
-      <class ref="org.drools.ws_ht.api.xsd.GetTaskInfo"/>
-    </bindings>
-    <bindings scd="tns:forwardResponse">
-      <class ref="org.drools.ws_ht.api.xsd.ForwardResponse"/>
-    </bindings>
-    <bindings scd="tns:addCommentResponse">
-      <class ref="org.drools.ws_ht.api.xsd.AddCommentResponse"/>
-    </bindings>
-    <bindings scd="tns:skip">
-      <class ref="org.drools.ws_ht.api.xsd.Skip"/>
-    </bindings>
-    <bindings scd="tns:startResponse">
-      <class ref="org.drools.ws_ht.api.xsd.StartResponse"/>
-    </bindings>
-    <bindings scd="tns:addComment">
-      <class ref="org.drools.ws_ht.api.xsd.AddComment"/>
-    </bindings>
-    <bindings scd="tns:deleteFaultResponse">
-      <class ref="org.drools.ws_ht.api.xsd.DeleteFaultResponse"/>
-    </bindings>
-    <bindings scd="tns:getOutputResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetOutputResponse"/>
-    </bindings>
-    <bindings scd="tns:getMyTasksResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetMyTasksResponse"/>
-    </bindings>
-    <bindings scd="tns:claimResponse">
-      <class ref="org.drools.ws_ht.api.xsd.ClaimResponse"/>
-    </bindings>
-    <bindings scd="tns:activateResponse">
-      <class ref="org.drools.ws_ht.api.xsd.ActivateResponse"/>
-    </bindings>
-    <bindings scd="tns:getMyTaskAbstracts">
-      <class ref="org.drools.ws_ht.api.xsd.GetMyTaskAbstracts"/>
-    </bindings>
-    <bindings scd="tns:stopResponse">
-      <class ref="org.drools.ws_ht.api.xsd.StopResponse"/>
-    </bindings>
-    <bindings scd="tns:claim">
-      <class ref="org.drools.ws_ht.api.xsd.Claim"/>
-    </bindings>
-    <bindings scd="tns:getMyTasks">
-      <class ref="org.drools.ws_ht.api.xsd.GetMyTasks"/>
-    </bindings>
-    <bindings scd="tns:start">
-      <class ref="org.drools.ws_ht.api.xsd.Start"/>
-    </bindings>
-    <bindings scd="tns:nominateResponse">
-      <class ref="org.drools.ws_ht.api.xsd.NominateResponse"/>
-    </bindings>
-    <bindings scd="tns:deleteOutputResponse">
-      <class ref="org.drools.ws_ht.api.xsd.DeleteOutputResponse"/>
-    </bindings>
-    <bindings scd="tns:removeResponse">
-      <class ref="org.drools.ws_ht.api.xsd.RemoveResponse"/>
-    </bindings>
-    <bindings scd="tns:getInputResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetInputResponse"/>
-    </bindings>
-    <bindings scd="tns:setGenericHumanRoleResponse">
-      <class ref="org.drools.ws_ht.api.xsd.SetGenericHumanRoleResponse"/>
-    </bindings>
-    <bindings scd="tns:getRenderingTypes">
-      <class ref="org.drools.ws_ht.api.xsd.GetRenderingTypes"/>
-    </bindings>
-    <bindings scd="tns:deleteFault">
-      <class ref="org.drools.ws_ht.api.xsd.DeleteFault"/>
-    </bindings>
-    <bindings scd="tns:deleteAttachmentsResponse">
-      <class ref="org.drools.ws_ht.api.xsd.DeleteAttachmentsResponse"/>
-    </bindings>
-    <bindings scd="tns:releaseResponse">
-      <class ref="org.drools.ws_ht.api.xsd.ReleaseResponse"/>
-    </bindings>
-    <bindings scd="tns:illegalState">
-      <class ref="org.drools.ws_ht.api.xsd.IllegalState"/>
-    </bindings>
-    <bindings scd="~tns:tTime">
-      <class ref="org.drools.ws_ht.api.xsd.TTime"/>
-    </bindings>
-    <bindings scd="tns:suspendResponse">
-      <class ref="org.drools.ws_ht.api.xsd.SuspendResponse"/>
-    </bindings>
-    <bindings scd="tns:setGenericHumanRole">
-      <class ref="org.drools.ws_ht.api.xsd.SetGenericHumanRole"/>
-    </bindings>
-    <bindings scd="tns:getCommentsResposne">
-      <class ref="org.drools.ws_ht.api.xsd.GetCommentsResposne"/>
-    </bindings>
-    <bindings scd="tns:getMyTaskAbstractsResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetMyTaskAbstractsResponse"/>
-    </bindings>
-    <bindings scd="tns:deleteAttachments">
-      <class ref="org.drools.ws_ht.api.xsd.DeleteAttachments"/>
-    </bindings>
-    <bindings scd="tns:addAttachmentResponse">
-      <class ref="org.drools.ws_ht.api.xsd.AddAttachmentResponse"/>
-    </bindings>
-    <bindings scd="tns:skipResponse">
-      <class ref="org.drools.ws_ht.api.xsd.SkipResponse"/>
-    </bindings>
-    <bindings scd="tns:suspendUntil">
-      <class ref="org.drools.ws_ht.api.xsd.SuspendUntil"/>
-    </bindings>
-    <bindings scd="tns:failResponse">
-      <class ref="org.drools.ws_ht.api.xsd.FailResponse"/>
-    </bindings>
-    <bindings scd="tns:getAttachmentsResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetAttachmentsResponse"/>
-    </bindings>
-    <bindings scd="tns:getRendering">
-      <class ref="org.drools.ws_ht.api.xsd.GetRendering"/>
-    </bindings>
-    <bindings scd="tns:setFault">
-      <class ref="org.drools.ws_ht.api.xsd.SetFault"/>
-    </bindings>
-    <bindings scd="tns:getAttachments">
-      <class ref="org.drools.ws_ht.api.xsd.GetAttachments"/>
-    </bindings>
-    <bindings scd="tns:setFaultResponse">
-      <class ref="org.drools.ws_ht.api.xsd.SetFaultResponse"/>
-    </bindings>
-    <bindings scd="tns:getAttachmentInfosResponse">
-      <class ref="org.drools.ws_ht.api.xsd.GetAttachmentInfosResponse"/>
-    </bindings>
-    <bindings scd="tns:setPriorityResponse">
-      <class ref="org.drools.ws_ht.api.xsd.SetPriorityResponse"/>
-    </bindings>
-    <bindings scd="tns:delegate">
-      <class ref="org.drools.ws_ht.api.xsd.Delegate"/>
-    </bindings>
-    <bindings scd="tns:getComments">
-      <class ref="org.drools.ws_ht.api.xsd.GetComments"/>
-    </bindings>
-    <bindings scd="tns:deleteOutput">
-      <class ref="org.drools.ws_ht.api.xsd.DeleteOutput"/>
-    </bindings>
-  </bindings>
-</bindings>
-

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/org/drools/task/service/operations-dsl.mvel
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/org/drools/task/service/operations-dsl.mvel	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/org/drools/task/service/operations-dsl.mvel	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,120 @@
+[   Operation.Claim 
+        : [ new OperationCommand().{ 
+                status = [ Status.Ready ],
+                allowed = [ Allowed.PotentialOwner, Allowed.BusinessAdministrator ],    
+                setNewOwnerToTargetUser = true,           
+                newStatus = Status.Reserved
+            } ],
+    Operation.Start 
+        : [ new OperationCommand().{ 
+                status = [ Status.Ready ],
+                allowed = [ Allowed.PotentialOwner ],  
+                setNewOwnerToTargetUser = true,              
+                newStatus = Status.InProgress
+            },
+            new OperationCommand().{ 
+                status = [ Status.Reserved ],
+                allowed = [ Allowed.Owner ],          
+                newStatus = Status.InProgress
+            } ],                  
+     Operation.Stop 
+        : [ new OperationCommand().{ 
+                status = [ Status.InProgress ],
+                allowed = [ Allowed.Owner, Allowed.BusinessAdministrator ],               
+                newStatus = Status.Reserved
+            } ],                 
+    Operation.Release 
+        : [ new OperationCommand().{ 
+                status = [ Status.Reserved, Status.InProgress ],
+                allowed = [Allowed.Owner, Allowed.BusinessAdministrator ],  
+                setNewOwnerToNull = true,            
+                newStatus = Status.Ready
+            } ],    
+    Operation.Suspend 
+        : [ new OperationCommand().{ 
+                status = [ Status.Ready ],
+                allowed = [ Allowed.PotentialOwner, Allowed.BusinessAdministrator  ],              
+                newStatus = Status.Suspended
+            },
+            new OperationCommand().{ 
+                status = [ Status.Reserved, Status.InProgress ],
+                allowed = [Allowed.Owner, Allowed.BusinessAdministrator ],          
+                newStatus = Status.Suspended
+            } ],   
+    Operation.Resume 
+        : [ new OperationCommand().{ 
+                previousStatus = [ Status.Ready ],
+                allowed = [ Allowed.PotentialOwner, Allowed.BusinessAdministrator  ],              
+                setToPreviousStatus = true
+            },
+            new OperationCommand().{ 
+                previousStatus = [ Status.Reserved, Status.InProgress ],
+                allowed = [ Allowed.Owner, Allowed.BusinessAdministrator ],          
+                setToPreviousStatus = true
+            } ],
+    Operation.Skip             
+        : [ new OperationCommand().{ 
+                status = [ Status.Created ],
+                allowed = [ Allowed.Initiator, Allowed.BusinessAdministrator  ],              
+                newStatus = Status.Obsolete
+            },
+            new OperationCommand().{ 
+                status = [ Status.Ready ],
+                allowed = [ Allowed.PotentialOwner, Allowed.BusinessAdministrator  ],              
+                newStatus = Status.Obsolete
+            },
+            new OperationCommand().{ 
+                status = [ Status.Reserved, Status.InProgress ],
+                allowed = [ Allowed.Owner, Allowed.BusinessAdministrator ],          
+                newStatus = Status.Obsolete
+            } ],
+    Operation.Delegate 
+        : [ new OperationCommand().{ 
+                status = [ Status.Ready ],
+                allowed = [ Allowed.PotentialOwner, Allowed.BusinessAdministrator  ],
+                addTargetUserToPotentialOwners = true, 
+                setNewOwnerToTargetUser = true,            
+                newStatus = Status.Ready,
+                exec = Operation.Claim
+            },
+            new OperationCommand().{ 
+                status = [ Status.Reserved, Status.InProgress ],
+                allowed = [ Allowed.Owner, Allowed.BusinessAdministrator ],
+                addTargetUserToPotentialOwners = true, 
+                setNewOwnerToTargetUser = true,                           
+                newStatus = Status.Ready,
+                exec = Operation.Claim
+            } ],
+    Operation.Forward 
+        : [ new OperationCommand().{ 
+                status = [ Status.Ready ],
+                allowed = [ Allowed.PotentialOwner, Allowed.BusinessAdministrator  ],
+                userIsExplicitPotentialOwner = true,                
+                addTargetUserToPotentialOwners = true,     
+                removeUserFromPotentialOwners = true,   
+                setNewOwnerToNull = true,         
+                newStatus = Status.Ready
+            },
+            new OperationCommand().{ 
+                status = [ Status.Reserved, Status.InProgress ],
+                allowed = [ Allowed.Owner, Allowed.BusinessAdministrator ],
+                userIsExplicitPotentialOwner = true,
+                addTargetUserToPotentialOwners = true,     
+                removeUserFromPotentialOwners = true, 
+                setNewOwnerToNull = true,                             
+                newStatus = Status.Ready
+            }],            
+    Operation.Complete 
+        : [ new OperationCommand().{ 
+                status = [ Status.InProgress ],
+                allowed = [ Allowed.Owner  ],      
+                newStatus = Status.Completed
+            } ],
+    Operation.Fail 
+        : [ new OperationCommand().{ 
+                status = [ Status.InProgress ],
+                allowed = [ Allowed.Owner  ],      
+                newStatus = Status.Failed
+            } ]                
+]          
+  
\ No newline at end of file

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api-wsdl.xsd
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api-wsdl.xsd	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api-wsdl.xsd	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,661 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"             
-	        xmlns:htd="http://www.drools.org/WS-HT" 
-	        xmlns:api="http://www.drools.org/WS-HT/api" 
-	        xmlns="http://www.drools.org/WS-HT/api/xsd" 
-	        targetNamespace="http://www.drools.org/WS-HT/api/xsd"	
-	        elementFormDefault="qualified" blockDefault="#all">
-	        
-	<xsd:import namespace="http://www.drools.org/WS-HT/api"
-		schemaLocation="ws-humantask-api.xsd" />
-	<xsd:import namespace="http://www.drools.org/WS-HT"
-		schemaLocation="ws-humantask.xsd" />
-	<xsd:element name="claim">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="claimResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="start">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="startResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="stop">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="stopResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="release">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="releaseResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="suspend">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="suspendResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="suspendUntil">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="time" type="tTime" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:complexType name="tTime">
-		<xsd:choice>
-			<xsd:element name="timePeriod" type="xsd:duration" />
-			<xsd:element name="pointOfTime" type="xsd:dateTime" />
-		</xsd:choice>
-	</xsd:complexType>
-	<xsd:element name="suspendUntilResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="resume">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="resumeResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="complete">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="taskData" type="xsd:anyType"
-					minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="completeResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="remove">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="removeResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="fail">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="faultName" type="xsd:NCName"
-					minOccurs="0" />
-				<xsd:element name="faultData" type="xsd:anyType"
-					minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="failResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setPriority">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="priority" type="xsd:nonNegativeInteger" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setPriorityResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="addAttachment">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="name" type="xsd:string" />
-				<xsd:element name="accessType" type="xsd:string" />
-				<xsd:element name="attachment" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="addAttachmentResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getAttachmentInfos">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getAttachmentInfosResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="info" type="api:tAttachmentInfo"
-					minOccurs="0" maxOccurs="unbounded" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getAttachments">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="attachmentName" type="xsd:string" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getAttachmentsResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="attachment" type="api:tAttachment"
-					minOccurs="0" maxOccurs="unbounded" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="deleteAttachments">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="attachmentName" type="xsd:string" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="deleteAttachmentsResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="addComment">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="text" type="xsd:string" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="addCommentResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getComments">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getCommentsResposne">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="comment" type="api:tComment"
-					minOccurs="0" maxOccurs="unbounded" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="skip">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="skipResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="forward">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="organizationalEntity" type="htd:tOrganizationalEntity" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="forwardResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="delegate">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="organizationalEntity" type="htd:tOrganizationalEntity" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="delegateResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getRendering">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyType" />
-				<xsd:element name="renderingType" type="xsd:QName" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getRenderingResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="rendering" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getRenderingTypes">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getRenderingTypesResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="renderingType" type="xsd:QName"
-					minOccurs="0" maxOccurs="unbounded" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getTaskInfo">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getTaskInfoResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="task" type="api:tTask" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getTaskDescription">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="contentType" type="xsd:string"
-					minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getTaskDescriptionResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="description" type="xsd:string" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setOutput">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="part" type="xsd:NCName" minOccurs="0" />
-				<xsd:element name="taskData" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setOutputResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="deleteOutput">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="deleteOutputResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setFault">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="faultName" type="xsd:NCName" />
-				<xsd:element name="faultData" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setFaultResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="deleteFault">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="deleteFaultResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getInput">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="part" type="xsd:NCName" minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getInputResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="taskData" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getOutput">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="part" type="xsd:NCName" minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getOutputResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="taskData" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getFault">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="faultName" type="xsd:NCName" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getFaultResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="faultName" type="xsd:NCName" />
-				<xsd:element name="faultData" type="xsd:anyType" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getMyTaskAbstracts">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="taskType" type="xsd:string" />
-				<xsd:element name="genericHumanRole" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="workQueue" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="status" type="api:tStatus" minOccurs="0"
-					maxOccurs="unbounded" />
-				<xsd:element name="whereClause" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="createdOnClause" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="maxTasks" type="xsd:int" minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getMyTaskAbstractsResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="taskAbstract" type="api:tTaskAbstract"
-					minOccurs="0" maxOccurs="unbounded" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getMyTasks">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="taskType" type="xsd:string" />
-				<xsd:element name="genericHumanRole" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="workQueue" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="status" type="api:tStatus" minOccurs="0"
-					maxOccurs="unbounded" />
-				<xsd:element name="whereClause" type="xsd:string" minOccurs="0" />
-				<xsd:element name="createdOnClause" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="maxTasks" type="xsd:int" minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="getMyTasksResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="taskAbstract" type="api:tTask"
-					minOccurs="0" maxOccurs="unbounded" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="query">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="selectClause" type="xsd:string" />
-				<xsd:element name="whereClause" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="orderByClause" type="xsd:string"
-					minOccurs="0" />
-				<xsd:element name="maxTasks" type="xsd:int" minOccurs="0" />
-				<xsd:element name="taskIndexOffset" type="xsd:int"
-					minOccurs="0" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="queryResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="query" type="api:tTaskQueryResultSet" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="activate">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="activateResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="nominate">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="organizationalEntity" type="htd:tOrganizationalEntity" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="nominateResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setGenericHumanRole">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="identifier" type="xsd:anyURI" />
-				<xsd:element name="genericHumanRole" type="xsd:string" />
-				<xsd:element name="organizationalEntity" type="htd:tOrganizationalEntity" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="setGenericHumanRoleResponse">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:annotation>
-					<xsd:documentation>Empty message</xsd:documentation>
-				</xsd:annotation>
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="illegalState">
-		<xsd:complexType>
-			<xsd:sequence>
-				<xsd:element name="status" type="api:tStatus" />
-				<xsd:element name="message" type="xsd:string" />
-			</xsd:sequence>
-		</xsd:complexType>
-	</xsd:element>
-	<xsd:element name="illegalArgument" type="xsd:string" />
-	<xsd:element name="illegalAccess" type="xsd:string" />
-	<xsd:element name="illegalOperation" type="xsd:string" />
-	<xsd:element name="recipientNotAllowed" type="xsd:string" />
-</xsd:schema>
\ No newline at end of file

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api.xsd
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api.xsd	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask-api.xsd	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,216 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns:htd="http://www.drools.org/WS-HT" 
-	        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-	        xmlns="http://www.drools.org/WS-HT/api"
-            targetNamespace="http://www.drools.org/WS-HT/api" 
-	        elementFormDefault="qualified" blockDefault="#all">
-<!-- other namespaces -->
-	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
-		schemaLocation="http://www.w3.org/2001/xml.xsd" />
-	<xsd:import namespace="http://www.drools.org/WS-HT"
-		schemaLocation="ws-humantask.xsd" />
-<!-- data types for attachment operations -->
-	<xsd:element name="attachmentInfo" type="tAttachmentInfo" />
-	<xsd:complexType name="tAttachmentInfo">
-		<xsd:sequence>
-			<xsd:element name="name" type="xsd:string" />
-			<xsd:element name="accessType" type="xsd:string" />
-			<xsd:element name="contentType" type="xsd:string" />
-			<xsd:element name="attachedAt" type="xsd:dateTime" />
-			<xsd:element name="attachedBy" type="htd:tUser" />
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="attachment" type="tAttachment" />
-	<xsd:complexType name="tAttachment">
-		<xsd:sequence>
-			<xsd:element ref="attachmentInfo" />
-			<xsd:element name="value" type="xsd:anyType" />
-		</xsd:sequence>
-	</xsd:complexType>
-<!-- data types for comments -->
-	<xsd:element name="comment" type="tComment" />
-	<xsd:complexType name="tComment">
-		<xsd:sequence>
-			<xsd:element name="addedAt" type="xsd:dateTime" />
-			<xsd:element name="addedBy" type="htd:tUser" />
-			<xsd:element name="text" type="xsd:string" />
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-	</xsd:complexType>
-<!-- data types for simple query operations -->
-	<xsd:element name="taskAbstract" type="tTaskAbstract" />
-	<xsd:complexType name="tTaskAbstract">
-		<xsd:sequence>
-			<xsd:element name="id" type="xsd:string" />
-			<xsd:element name="taskType" type="xsd:string" />
-			<xsd:element name="name" type="xsd:QName" />
-			<xsd:element name="status" type="tStatus" />
-			<xsd:element name="priority" type="xsd:nonNegativeInteger"
-				minOccurs="0" />
-			<xsd:element name="createdOn" type="xsd:dateTime" />
-			<xsd:element name="activationTime" type="xsd:dateTime"
-				minOccurs="0" />
-			<xsd:element name="expirationTime" type="xsd:dateTime"
-				minOccurs="0" />
-			<xsd:element name="isSkipable" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasPotentialOwners" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="startByExists" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="completeByExists" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="presentationName" type="tPresentationName"
-				minOccurs="0" />
-			<xsd:element name="presentationSubject" type="tPresentationSubject"
-				minOccurs="0" />
-			<xsd:element name="renderingMethodExists" type="xsd:boolean" />
-			<xsd:element name="hasOutput" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasFault" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasAttachments" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasComments" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="escalated" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="task" type="tTask" />
-	<xsd:complexType name="tTask">
-		<xsd:sequence>
-			<xsd:element name="id" type="xsd:string" />
-			<xsd:element name="taskType" type="xsd:string" />
-			<xsd:element name="name" type="xsd:QName" />
-			<xsd:element name="status" type="tStatus" />
-			<xsd:element name="priority" type="xsd:nonNegativeInteger"
-				minOccurs="0" />
-			<xsd:element name="taskInitiator" type="htd:tUser"
-				minOccurs="0" />
-			<xsd:element name="taskStakeholders" type="htd:tOrganizationalEntity"
-				minOccurs="0" />
-			<xsd:element name="potentialOwners" type="htd:tOrganizationalEntity"
-				minOccurs="0" />
-			<xsd:element name="businessAdministrators" type="htd:tOrganizationalEntity"
-				minOccurs="0" />
-			<xsd:element name="actualOwner" type="htd:tUser"
-				minOccurs="0" />
-			<xsd:element name="notificationRecipients" type="htd:tOrganizationalEntity"
-				minOccurs="0" />
-			<xsd:element name="createdOn" type="xsd:dateTime" />
-			<xsd:element name="createdBy" type="xsd:string"
-				minOccurs="0" />
-			<xsd:element name="activationTime" type="xsd:dateTime"
-				minOccurs="0" />
-			<xsd:element name="expirationTime" type="xsd:dateTime"
-				minOccurs="0" />
-			<xsd:element name="isSkipable" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasPotentialOwners" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="startByExists" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="completeByExists" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="presentationName" type="tPresentationName"
-				minOccurs="0" />
-			<xsd:element name="presentationSubject" type="tPresentationSubject"
-				minOccurs="0" />
-			<xsd:element name="renderingMethodExists" type="xsd:boolean" />
-			<xsd:element name="hasOutput" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasFault" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasAttachments" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="hasComments" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="escalated" type="xsd:boolean"
-				minOccurs="0" />
-			<xsd:element name="primarySearchBy" type="xsd:string"
-				minOccurs="0" />
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:simpleType name="tPresentationName">
-		<xsd:annotation>
-			<xsd:documentation>length-restricted string</xsd:documentation>
-		</xsd:annotation>
-		<xsd:restriction base="xsd:string">
-			<xsd:maxLength value="64" />
-			<xsd:whiteSpace value="preserve" />
-		</xsd:restriction>
-	</xsd:simpleType>
-	<xsd:simpleType name="tPresentationSubject">
-		<xsd:annotation>
-			<xsd:documentation>length-restricted string</xsd:documentation>
-		</xsd:annotation>
-		<xsd:restriction base="xsd:string">
-			<xsd:maxLength value="254" />
-			<xsd:whiteSpace value="preserve" />
-		</xsd:restriction>
-	</xsd:simpleType>
-	<xsd:simpleType name="tStatus">
-		<xsd:restriction base="xsd:string">
-			<xsd:enumeration value="CREATED" />
-			<xsd:enumeration value="READY" />
-			<xsd:enumeration value="RESERVED" />
-			<xsd:enumeration value="IN_PROGRESS" />
-			<xsd:enumeration value="SUSPENDED" />
-			<xsd:enumeration value="COMPLETED" />
-			<xsd:enumeration value="FAILED" />
-			<xsd:enumeration value="ERROR" />
-			<xsd:enumeration value="EXITED" />
-			<xsd:enumeration value="OBSOLETE" />
-		</xsd:restriction>
-	</xsd:simpleType>
-<!-- data types for advanced query operations -->
-	<xsd:element name="taskQueryResultSet" type="tTaskQueryResultSet" />
-	<xsd:complexType name="tTaskQueryResultSet">
-		<xsd:sequence>
-			<xsd:element name="row" type="tTaskQueryResultRow"
-				minOccurs="0" maxOccurs="unbounded" />
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:complexType name="tTaskQueryResultRow">
-		<xsd:choice minOccurs="0" maxOccurs="unbounded">
-			<xsd:element name="id" type="xsd:string" />
-			<xsd:element name="taskType" type="xsd:string" />
-			<xsd:element name="name" type="xsd:QName" />
-			<xsd:element name="status" type="tStatus" />
-			<xsd:element name="priority" type="xsd:nonNegativeInteger" />
-			<xsd:element name="taskInitiator" type="htd:tOrganizationalEntity" />
-			<xsd:element name="taskStakeholders" type="htd:tOrganizationalEntity" />
-			<xsd:element name="potentialOwners" type="htd:tOrganizationalEntity" />
-			<xsd:element name="businessAdministrators" type="htd:tOrganizationalEntity" />
-			<xsd:element name="actualOwner" type="htd:tUser" />
-			<xsd:element name="notificationRecipients" type="htd:tOrganizationalEntity" />
-			<xsd:element name="createdOn" type="xsd:dateTime" />
-			<xsd:element name="createdBy" type="xsd:string" />
-			<xsd:element name="activationTime" type="xsd:dateTime" />
-			<xsd:element name="expirationTime" type="xsd:dateTime" />
-			<xsd:element name="isSkipable" type="xsd:boolean" />
-			<xsd:element name="hasPotentialOwners" type="xsd:boolean" />
-			<xsd:element name="startByExists" type="xsd:boolean" />
-			<xsd:element name="completeByExists" type="xsd:boolean" />
-			<xsd:element name="presentationName" type="tPresentationName" />
-			<xsd:element name="presentationSubject" type="tPresentationSubject" />
-			<xsd:element name="presentationDescription" type="xsd:string" />
-			<xsd:element name="renderingMethodExists" type="xsd:boolean" />
-			<xsd:element name="hasOutput" type="xsd:boolean" />
-			<xsd:element name="hasFault" type="xsd:boolean" />
-			<xsd:element name="hasAttachments" type="xsd:boolean" />
-			<xsd:element name="hasComments" type="xsd:boolean" />
-			<xsd:element name="escalated" type="xsd:boolean" />
-			<xsd:element name="primarySearchBy" type="xsd:string" />
-			<xsd:any namespace="##other" processContents="lax" />
-		</xsd:choice>
-	</xsd:complexType>
-</xsd:schema>
\ No newline at end of file

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.wsdl
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.wsdl	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.wsdl	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,520 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"	 
-				  xmlns:htd="http://www.drools.org/WS-HT"
-	              xmlns:htda="http://www.drools.org/WS-HT/api" 
-	              xmlns:htdt="http://www.drools.org/WS-HT/api/xsd"
-                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 	
-	              xmlns="http://www.drools.org/WS-HT/api/wsdl"
-	              targetNamespace="http://www.drools.org/WS-HT/api/wsdl">
-	
-
-	<wsdl:types>
-		<xsd:schema>
-			<xsd:import namespace="http://www.drools.org/WS-HT"
-				schemaLocation="ws-humantask.xsd" />
-			<xsd:import namespace="http://www.drools.org/WS-HT/api"
-				schemaLocation="ws-humantask-api.xsd" />
-			<xsd:import namespace="http://www.drools.org/WS-HT/api/xsd"
-				schemaLocation="ws-humantask-api-wsdl.xsd" />
-		</xsd:schema>
-	</wsdl:types>
-	
-<!-- Declaration of messages -->
-	<wsdl:message name="claim">
-		<wsdl:part name="claim" element="htdt:claim" />
-	</wsdl:message>
-	<wsdl:message name="claimResponse">
-		<wsdl:part name="claimResponse" element="htdt:claimResponse" />
-	</wsdl:message>
-	<wsdl:message name="start">
-		<wsdl:part name="start" element="htdt:start" />
-	</wsdl:message>
-	<wsdl:message name="startResponse">
-		<wsdl:part name="startResponse" element="htdt:startResponse" />
-	</wsdl:message>
-	<wsdl:message name="stop">
-		<wsdl:part name="stop" element="htdt:stop" />
-	</wsdl:message>
-	<wsdl:message name="stopResponse">
-		<wsdl:part name="stopResponse" element="htdt:stopResponse" />
-	</wsdl:message>
-	<wsdl:message name="release">
-		<wsdl:part name="release" element="htdt:release" />
-	</wsdl:message>
-	<wsdl:message name="releaseResponse">
-		<wsdl:part name="releaseResponse" element="htdt:releaseResponse" />
-	</wsdl:message>
-	<wsdl:message name="suspend">
-		<wsdl:part name="suspend" element="htdt:suspend" />
-	</wsdl:message>
-	<wsdl:message name="suspendResponse">
-		<wsdl:part name="suspendResponse" element="htdt:suspendResponse" />
-	</wsdl:message>
-	<wsdl:message name="suspendUntil">
-		<wsdl:part name="suspendUntil" element="htdt:suspendUntil" />
-	</wsdl:message>
-	<wsdl:message name="suspendUntilResponse">
-		<wsdl:part name="suspendUntilResponse" element="htdt:suspendUntilResponse" />
-	</wsdl:message>
-	<wsdl:message name="resume">
-		<wsdl:part name="resume" element="htdt:resume" />
-	</wsdl:message>
-	<wsdl:message name="resumeResponse">
-		<wsdl:part name="resumeResponse" element="htdt:resumeResponse" />
-	</wsdl:message>
-	<wsdl:message name="complete">
-		<wsdl:part name="complete" element="htdt:complete" />
-	</wsdl:message>
-	<wsdl:message name="completeResponse">
-		<wsdl:part name="completeResponse" element="htdt:completeResponse" />
-	</wsdl:message>
-	<wsdl:message name="remove">
-		<wsdl:part name="remove" element="htdt:remove" />
-	</wsdl:message>
-	<wsdl:message name="removeResponse">
-		<wsdl:part name="removeResponse" element="htdt:removeResponse" />
-	</wsdl:message>
-	<wsdl:message name="fail">
-		<wsdl:part name="fail" element="htdt:fail" />
-	</wsdl:message>
-	<wsdl:message name="failResponse">
-		<wsdl:part name="failResponse" element="htdt:failResponse" />
-	</wsdl:message>
-	<wsdl:message name="setPriority">
-		<wsdl:part name="setPriority" element="htdt:setPriority" />
-	</wsdl:message>
-	<wsdl:message name="setPriorityResponse">
-		<wsdl:part name="setPriorityResponse" element="htdt:setPriorityResponse" />
-	</wsdl:message>
-	<wsdl:message name="addAttachment">
-		<wsdl:part name="addAttachment" element="htdt:addAttachment" />
-	</wsdl:message>
-	<wsdl:message name="addAttachmentResponse">
-		<wsdl:part name="addAttachmentResponse" element="htdt:addAttachmentResponse" />
-	</wsdl:message>
-	<wsdl:message name="getAttachmentInfos">
-		<wsdl:part name="getAttachmentInfos" element="htdt:getAttachmentInfos" />
-	</wsdl:message>
-	<wsdl:message name="getAttachmentInfosResponse">
-		<wsdl:part name="getAttachmentInfosResponse" element="htdt:getAttachmentInfosResponse" />
-	</wsdl:message>
-	<wsdl:message name="getAttachments">
-		<wsdl:part name="getAttachments" element="htdt:getAttachments" />
-	</wsdl:message>
-	<wsdl:message name="getAttachmentsResponse">
-		<wsdl:part name="getAttachmentsResponse" element="htdt:getAttachmentsResponse" />
-	</wsdl:message>
-	<wsdl:message name="deleteAttachments">
-		<wsdl:part name="deleteAttachments" element="htdt:deleteAttachments" />
-	</wsdl:message>
-	<wsdl:message name="deleteAttachmentsResponse">
-		<wsdl:part name="deleteAttachmentsResponse" element="htdt:deleteAttachmentsResponse" />
-	</wsdl:message>
-	<wsdl:message name="addComment">
-		<wsdl:part name="addComment" element="htdt:addComment" />
-	</wsdl:message>
-	<wsdl:message name="addCommentResponse">
-		<wsdl:part name="addCommentResponse" element="htdt:addCommentResponse" />
-	</wsdl:message>
-	<wsdl:message name="getComments">
-		<wsdl:part name="getComments" element="htdt:getComments" />
-	</wsdl:message>
-	<wsdl:message name="getCommentsResponse">
-		<wsdl:part name="getCommentsRespons" element="htdt:getCommentsResposne" />
-	</wsdl:message>
-	<wsdl:message name="skip">
-		<wsdl:part name="skip" element="htdt:skip" />
-	</wsdl:message>
-	<wsdl:message name="skipResponse">
-		<wsdl:part name="skipResponse" element="htdt:skipResponse" />
-	</wsdl:message>
-	<wsdl:message name="forward">
-		<wsdl:part name="forward" element="htdt:forward" />
-	</wsdl:message>
-	<wsdl:message name="forwardResponse">
-		<wsdl:part name="forwardResponse" element="htdt:forwardResponse" />
-	</wsdl:message>
-	<wsdl:message name="delegate">
-		<wsdl:part name="delegate" element="htdt:delegate" />
-	</wsdl:message>
-	<wsdl:message name="delegateResponse">
-		<wsdl:part name="delegateResponse" element="htdt:delegateResponse" />
-	</wsdl:message>
-	<wsdl:message name="getRendering">
-		<wsdl:part name="getRendering" element="htdt:getRendering" />
-	</wsdl:message>
-	<wsdl:message name="getRenderingResponse">
-		<wsdl:part name="getRenderingResponse" element="htdt:getRenderingResponse" />
-	</wsdl:message>
-	<wsdl:message name="getRenderingTypes">
-		<wsdl:part name="getRenderingTypes" element="htdt:getRenderingTypes" />
-	</wsdl:message>
-	<wsdl:message name="getRenderingTypesResponse">
-		<wsdl:part name="getRenderingTypesResponse" element="htdt:getRenderingTypesResponse" />
-	</wsdl:message>
-	<wsdl:message name="getTaskInfo">
-		<wsdl:part name="getTaskInfo" element="htdt:getTaskInfo" />
-	</wsdl:message>
-	<wsdl:message name="getTaskInfoResponse">
-		<wsdl:part name="getTaskInfoResponse" element="htdt:getTaskInfoResponse" />
-	</wsdl:message>
-	<wsdl:message name="getTaskDescription">
-		<wsdl:part name="getTaskDescription" element="htdt:getTaskDescription" />
-	</wsdl:message>
-	<wsdl:message name="getTaskDescriptionResponse">
-		<wsdl:part name="getTaskDescriptionResponse" element="htdt:getTaskDescriptionResponse" />
-	</wsdl:message>
-	<wsdl:message name="setOutput">
-		<wsdl:part name="setOutput" element="htdt:setOutput" />
-	</wsdl:message>
-	<wsdl:message name="setOutputResponse">
-		<wsdl:part name="setOutputResponse" element="htdt:setOutputResponse" />
-	</wsdl:message>
-	<wsdl:message name="deleteOutput">
-		<wsdl:part name="deleteOutput" element="htdt:deleteOutput" />
-	</wsdl:message>
-	<wsdl:message name="deleteOutputResponse">
-		<wsdl:part name="deleteOutputResponse" element="htdt:deleteOutputResponse" />
-	</wsdl:message>
-	<wsdl:message name="setFault">
-		<wsdl:part name="setFault" element="htdt:setFault" />
-	</wsdl:message>
-	<wsdl:message name="setFaultResponse">
-		<wsdl:part name="setFaultResponse" element="htdt:setFaultResponse" />
-	</wsdl:message>
-	<wsdl:message name="deleteFault">
-		<wsdl:part name="deleteFault" element="htdt:deleteFault" />
-	</wsdl:message>
-	<wsdl:message name="deleteFaultResponse">
-		<wsdl:part name="deleteFaultResponse" element="htdt:deleteFaultResponse" />
-	</wsdl:message>
-	<wsdl:message name="getInput">
-		<wsdl:part name="getInput" element="htdt:getInput" />
-	</wsdl:message>
-	<wsdl:message name="getInputResponse">
-		<wsdl:part name="getInputResponse" element="htdt:getInputResponse" />
-	</wsdl:message>
-	<wsdl:message name="getOutput">
-		<wsdl:part name="getOutput" element="htdt:getOutput" />
-	</wsdl:message>
-	<wsdl:message name="getOutputResponse">
-		<wsdl:part name="getOutputResponse" element="htdt:getOutputResponse" />
-	</wsdl:message>
-	<wsdl:message name="getFault">
-		<wsdl:part name="getFault" element="htdt:getFault" />
-	</wsdl:message>
-	<wsdl:message name="getFaultResponse">
-		<wsdl:part name="getFaultResponse" element="htdt:getFaultResponse" />
-	</wsdl:message>
-	<wsdl:message name="getMyTaskAbstracts">
-		<wsdl:part name="getMyTaskAbstracts" element="htdt:getMyTaskAbstracts" />
-	</wsdl:message>
-	<wsdl:message name="getMyTaskAbstractsResponse">
-		<wsdl:part name="getMyTaskAbstractsResponse" element="htdt:getMyTaskAbstractsResponse" />
-	</wsdl:message>
-	<wsdl:message name="getMyTasks">
-		<wsdl:part name="getMyTasks" element="htdt:getMyTasks" />
-	</wsdl:message>
-	<wsdl:message name="getMyTasksResponse">
-		<wsdl:part name="getMyTasksResponse" element="htdt:getMyTasksResponse" />
-	</wsdl:message>
-	<wsdl:message name="query">
-		<wsdl:part name="query" element="htdt:query" />
-	</wsdl:message>
-	<wsdl:message name="queryResponse">
-		<wsdl:part name="queryResponse" element="htdt:queryResponse" />
-	</wsdl:message>
-	<wsdl:message name="activate">
-		<wsdl:part name="activate" element="htdt:activate" />
-	</wsdl:message>
-	<wsdl:message name="activateResponse">
-		<wsdl:part name="activateResponse" element="htdt:activateResponse" />
-	</wsdl:message>
-	<wsdl:message name="nominate">
-		<wsdl:part name="nominate" element="htdt:nominate" />
-	</wsdl:message>
-	<wsdl:message name="nominateResponse">
-		<wsdl:part name="nominateRespons" element="htdt:nominateResponse" />
-	</wsdl:message>
-	<wsdl:message name="setGenericHumanRole">
-		<wsdl:part name="setGenericHumanRole" element="htdt:setGenericHumanRole" />
-	</wsdl:message>
-	<wsdl:message name="setGenericHumanRoleResponse">
-		<wsdl:part name="setGenericHumanRoleResponse" element="htdt:setGenericHumanRoleResponse" />
-	</wsdl:message>
-	
-<!-- Declaration of fault messages -->
-	<wsdl:message name="illegalStateFault">
-		<wsdl:part name="illegalState" element="htdt:illegalState" />
-	</wsdl:message>
-	<wsdl:message name="illegalArgumentFault">
-		<wsdl:part name="illegalArgument" element="htdt:illegalArgument" />
-	</wsdl:message>
-	<wsdl:message name="illegalAccessFault">
-		<wsdl:part name="illegalAccess" element="htdt:illegalAccess" />
-	</wsdl:message>
-	<wsdl:message name="illegalOperationFault">
-		<wsdl:part name="illegalOperation" element="htdt:illegalOperation" />
-	</wsdl:message>
-	<wsdl:message name="recipientNotAllowed">
-		<wsdl:part name="recipientNotAllowed" element="htdt:recipientNotAllowed" />
-	</wsdl:message>
-	
-	
-<!-- Port type definition -->
-	<wsdl:portType name="taskOperations">
-		<wsdl:operation name="claim">
-			<wsdl:input message="claim" />
-			<wsdl:output message="claimResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="start">
-			<wsdl:input message="start" />
-			<wsdl:output message="startResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="stop">
-			<wsdl:input message="stop" />
-			<wsdl:output message="stopResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="release">
-			<wsdl:input message="release" />
-			<wsdl:output message="releaseResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="suspend">
-			<wsdl:input message="suspend" />
-			<wsdl:output message="suspendResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="suspendUntil">
-			<wsdl:input message="suspendUntil" />
-			<wsdl:output message="suspendUntilResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="resume">
-			<wsdl:input message="resume" />
-			<wsdl:output message="resumeResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="complete">
-			<wsdl:input message="complete" />
-			<wsdl:output message="completeResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="remove">
-			<wsdl:input message="remove" />
-			<wsdl:output message="removeResponse" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="fail">
-			<wsdl:input message="fail" />
-			<wsdl:output message="failResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-			<wsdl:fault name="illegalOperationFault" message="illegalOperationFault" />
-		</wsdl:operation>
-		<wsdl:operation name="setPriority">
-			<wsdl:input message="setPriority" />
-			<wsdl:output message="setPriorityResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="addAttachment">
-			<wsdl:input message="addAttachment" />
-			<wsdl:output message="addAttachmentResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getAttachmentInfos">
-			<wsdl:input message="getAttachmentInfos" />
-			<wsdl:output message="getAttachmentInfosResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getAttachments">
-			<wsdl:input message="getAttachments" />
-			<wsdl:output message="getAttachmentsResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="deleteAttachments">
-			<wsdl:input message="deleteAttachments" />
-			<wsdl:output message="deleteAttachmentsResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="addComment">
-			<wsdl:input message="addComment" />
-			<wsdl:output message="addCommentResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getComments">
-			<wsdl:input message="getComments" />
-			<wsdl:output message="getCommentsResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="skip">
-			<wsdl:input message="skip" />
-			<wsdl:output message="skipResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-			<wsdl:fault name="illegalOperationFault" message="illegalOperationFault" />
-		</wsdl:operation>
-		<wsdl:operation name="forward">
-			<wsdl:input message="forward" />
-			<wsdl:output message="forwardResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="delegate">
-			<wsdl:input message="delegate" />
-			<wsdl:output message="delegateResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-			<wsdl:fault name="recipientNotAllowed" message="recipientNotAllowed" />
-		</wsdl:operation>
-		<wsdl:operation name="getRendering">
-			<wsdl:input message="getRendering" />
-			<wsdl:output message="getRenderingResponse" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getRenderingTypes">
-			<wsdl:input message="getRenderingTypes" />
-			<wsdl:output message="getRenderingTypesResponse" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getTaskInfo">
-			<wsdl:input message="getTaskInfo" />
-			<wsdl:output message="getTaskInfoResponse" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getTaskDescription">
-			<wsdl:input message="getTaskDescription" />
-			<wsdl:output message="getTaskDescriptionResponse" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-		</wsdl:operation>
-		<wsdl:operation name="setOutput">
-			<wsdl:input message="setOutput" />
-			<wsdl:output message="setOutputResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="deleteOutput">
-			<wsdl:input message="deleteOutput" />
-			<wsdl:output message="deleteOutputResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="setFault">
-			<wsdl:input message="setFault" />
-			<wsdl:output message="setFaultResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-			<wsdl:fault name="illegalOperationFault" message="illegalOperationFault" />
-		</wsdl:operation>
-		<wsdl:operation name="deleteFault">
-			<wsdl:input message="deleteFault" />
-			<wsdl:output message="deleteFaultResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getInput">
-			<wsdl:input message="getInput" />
-			<wsdl:output message="getInputResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getOutput">
-			<wsdl:input message="getOutput" />
-			<wsdl:output message="getOutputResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getFault">
-			<wsdl:input message="getFault" />
-			<wsdl:output message="getFaultResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-			<wsdl:fault name="illegalOperationFault" message="illegalOperationFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getMyTaskAbstracts">
-			<wsdl:input message="getMyTaskAbstracts" />
-			<wsdl:output message="getMyTaskAbstractsResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-		</wsdl:operation>
-		<wsdl:operation name="getMyTasks">
-			<wsdl:input message="getMyTasks" />
-			<wsdl:output message="getMyTasksResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-		</wsdl:operation>
-		<wsdl:operation name="query">
-			<wsdl:input message="query" />
-			<wsdl:output message="queryResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-		</wsdl:operation>
-		<wsdl:operation name="activate">
-			<wsdl:input message="activate" />
-			<wsdl:output message="activateResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="nominate">
-			<wsdl:input message="nominate" />
-			<wsdl:output message="nominateResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-		<wsdl:operation name="setGenericHumanRole">
-			<wsdl:input message="setGenericHumanRole" />
-			<wsdl:output message="setGenericHumanRoleResponse" />
-			<wsdl:fault name="illegalStateFault" message="illegalStateFault" />
-			<wsdl:fault name="illegalArgumentFault" message="illegalArgumentFault" />
-			<wsdl:fault name="illegalAccessFault" message="illegalAccessFault" />
-		</wsdl:operation>
-	</wsdl:portType>	
-
-</wsdl:definitions>
\ No newline at end of file

Deleted: labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.xsd
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.xsd	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/main/resources/ws-humantask.xsd	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,519 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-	        xmlns="http://www.drools.org/WS-HT" 
-	        targetNamespace="http://www.drools.org/WS-HT" 
-	        elementFormDefault="qualified" blockDefault="#all">
-	        
-	<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
-		schemaLocation="http://www.w3.org/2001/xml.xsd" />
-		
-<!-- base types for extensible elements -->
-	<xsd:complexType name="tExtensibleElements">
-		<xsd:sequence>
-			<xsd:element name="documentation" type="tDocumentation"
-				minOccurs="0" maxOccurs="unbounded" />
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:anyAttribute namespace="##other"
-			processContents="lax" />
-	</xsd:complexType>
-	<xsd:complexType name="tDocumentation" mixed="true">
-		<xsd:sequence>
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:attribute ref="xml:lang" />
-	</xsd:complexType>
-	<xsd:complexType name="tExtensibleMixedContentElements"
-		mixed="true">
-		<xsd:sequence>
-			<xsd:element name="documentation" type="tDocumentation"
-				minOccurs="0" maxOccurs="unbounded" />
-			<xsd:any namespace="##other" processContents="skip"
-				minOccurs="0" maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:anyAttribute namespace="##other"
-			processContents="lax" />
-	</xsd:complexType>
-	
-<!-- human task definition -->
-	<xsd:element name="humanInteractions" type="tHumanInteractions" />
-	<xsd:complexType name="tHumanInteractions">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="extensions" type="tExtensions"
-						minOccurs="0" />
-					<xsd:element name="import" type="tImport" minOccurs="0"
-						maxOccurs="unbounded" />
-					<xsd:element ref="logicalPeopleGroups" minOccurs="0" />
-					<xsd:element ref="tasks" minOccurs="0" />
-					<xsd:element ref="notifications" minOccurs="0" />
-				</xsd:sequence>
-				<xsd:attribute name="targetNamespace" type="xsd:anyURI"
-					use="required" />
-				<xsd:attribute name="queryLanguage" type="xsd:anyURI" />
-				<xsd:attribute name="expressionLanguage" type="xsd:anyURI" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tExtensions">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="extension" type="tExtension"
-						maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tExtension">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:attribute name="namespace" type="xsd:anyURI" use="required" />
-				<xsd:attribute name="mustUnderstand" type="tBoolean"
-					use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:element name="import" type="tImport" />
-	<xsd:complexType name="tImport">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:attribute name="namespace" type="xsd:anyURI" use="optional" />
-				<xsd:attribute name="location" type="xsd:anyURI" use="optional" />
-				<xsd:attribute name="importType" type="xsd:anyURI"
-					use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:element name="logicalPeopleGroups" type="tLogicalPeopleGroups" />
-	<xsd:complexType name="tLogicalPeopleGroups">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="logicalPeopleGroup" type="tLogicalPeopleGroup"
-						maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tLogicalPeopleGroup">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="parameter" type="tParameter"
-						minOccurs="0" maxOccurs="unbounded" />
-				</xsd:sequence>
-				<xsd:attribute name="name" type="xsd:NCName" use="required" />
-				<xsd:attribute name="reference" type="xsd:NCName" use="optional" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	
-<!-- generic human roles used in tasks and notifications -->
-	<xsd:group name="genericHumanRole">
-		<xsd:choice>
-			<xsd:element ref="potentialOwners" />
-			<xsd:element ref="excludedOwners" />
-			<xsd:element ref="taskInitiator" />
-			<xsd:element ref="taskStakeholders" />
-			<xsd:element ref="businessAdministrators" />
-			<xsd:element ref="recipients" />
-		</xsd:choice>
-	</xsd:group>
-	<xsd:element name="potentialOwners" type="tGenericHumanRole" />
-	<xsd:element name="excludedOwners" type="tGenericHumanRole" />
-	<xsd:element name="taskInitiator" type="tGenericHumanRole" />
-	<xsd:element name="taskStakeholders" type="tGenericHumanRole" />
-	<xsd:element name="businessAdministrators" type="tGenericHumanRole" />
-	<xsd:element name="recipients" type="tGenericHumanRole" />
-	<xsd:complexType name="tGenericHumanRole">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="from" type="tFrom" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-<!-- elements and types for organizational entities -->
-	<xsd:element name="organizationalEntity" type="tOrganizationalEntity" />
-	<xsd:complexType name="tOrganizationalEntity">
-		<xsd:choice>
-			<xsd:element ref="users" />
-			<xsd:element ref="groups" />
-		</xsd:choice>
-	</xsd:complexType>
-	<xsd:element name="user" type="tUser" />
-	<xsd:simpleType name="tUser">
-		<xsd:restriction base="xsd:string" />
-	</xsd:simpleType>
-	<xsd:element name="users" type="tUserlist" />
-	<xsd:complexType name="tUserlist">
-		<xsd:sequence>
-			<xsd:element ref="user" minOccurs="0" maxOccurs="unbounded" />
-		</xsd:sequence>
-	</xsd:complexType>
-	<xsd:element name="group" type="tGroup" />
-	<xsd:simpleType name="tGroup">
-		<xsd:restriction base="xsd:string" />
-	</xsd:simpleType>
-	<xsd:element name="groups" type="tGrouplist" />
-	<xsd:complexType name="tGrouplist">
-		<xsd:sequence>
-			<xsd:element ref="group" minOccurs="0" maxOccurs="unbounded" />
-		</xsd:sequence>
-	</xsd:complexType>
-<!-- human tasks -->
-	<xsd:element name="tasks" type="tTasks" />
-	<xsd:complexType name="tTasks">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element ref="task" maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:element name="task" type="tTask" />
-	<xsd:complexType name="tTask">
-		<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: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:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:attribute name="portType" type="xsd:QName" use="required" />
-				<xsd:attribute name="operation" type="xsd:NCName" use="required" />
-				<xsd:attribute name="responsePortType" type="xsd:QName"
-					use="optional" />
-				<xsd:attribute name="responseOperation" type="xsd:NCName"
-					use="optional" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-<!-- presentation elements -->
-	<xsd:complexType name="tPresentationElements">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="name" type="tText" minOccurs="0"
-						maxOccurs="unbounded" />
-					<xsd:element name="presentationParameters" type="tPresentationParameters"
-						minOccurs="0" />
-					<xsd:element name="subject" type="tText" minOccurs="0"
-						maxOccurs="unbounded" />
-					<xsd:element name="description" type="tDescription"
-						minOccurs="0" maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tPresentationParameters">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="presentationParameter" type="tPresentationParameter"
-						maxOccurs="unbounded" />
-				</xsd:sequence>
-				<xsd:attribute name="expressionLanguage" type="xsd:anyURI" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tPresentationParameter">
-		<xsd:complexContent>
-			<xsd:extension base="tParameter" />
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tRenderings">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="rendering" type="tRendering"
-						maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-<!-- elements for rendering tasks -->
-	<xsd:complexType name="tRendering">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:attribute name="type" type="xsd:QName" use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-<!-- elements for people assignment -->
-	<xsd:element name="peopleAssignments" type="tPeopleAssignments" />
-	<xsd:complexType name="tPeopleAssignments">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:group ref="genericHumanRole" minOccurs="0"
-						maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-<!-- elements for handling timeouts and escalation -->
-	<xsd:complexType name="tDeadlines">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="startDeadline" type="tDeadline"
-						minOccurs="0" maxOccurs="unbounded" />
-					<xsd:element name="completionDeadline" type="tDeadline"
-						minOccurs="0" maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tDeadline">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:choice>
-						<xsd:element name="for" type="tDuration-expr" />
-						<xsd:element name="until" type="tDeadline-expr" />
-					</xsd:choice>
-					<xsd:element name="escalation" type="tEscalation"
-						minOccurs="0" maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tEscalation">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="condition" type="tBoolean-expr"
-						minOccurs="0" />
-					<xsd:element name="toParts" type="tToParts" minOccurs="0"
-						maxOccurs="unbounded" />
-					<xsd:choice>
-						<xsd:element ref="notification" />
-						<xsd:element name="localNotification" type="tLocalNotification" />
-						<xsd:element name="reassignment" type="tReassignment" />
-					</xsd:choice>
-				</xsd:sequence>
-				<xsd:attribute name="name" type="xsd:NCName" use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tLocalNotification">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:choice>
-					<xsd:sequence>
-						<xsd:element ref="priority" minOccurs="0" />
-						<xsd:element ref="peopleAssignments" minOccurs="0" />
-					</xsd:sequence>
-				</xsd:choice>
-				<xsd:attribute name="reference" type="xsd:QName" use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tReassignment">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element ref="potentialOwners" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tToParts">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="toPart" type="tToPart" maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tToPart" mixed="true">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleMixedContentElements">
-				<xsd:attribute name="name" type="xsd:NCName" use="required" />
-				<xsd:attribute name="expressionLanguage" type="xsd:anyURI" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-<!-- task delegation -->
-	<xsd:complexType name="tDelegation">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="from" type="tFrom" minOccurs="0" />
-				</xsd:sequence>
-				<xsd:attribute name="potentialDelegatees" type="tPotentialDelegatees"
-					use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:simpleType name="tPotentialDelegatees">
-		<xsd:restriction base="xsd:string">
-			<xsd:enumeration value="anybody" />
-			<xsd:enumeration value="nobody" />
-			<xsd:enumeration value="potentialOwners" />
-			<xsd:enumeration value="other" />
-		</xsd:restriction>
-	</xsd:simpleType>
-<!-- notifications -->
-	<xsd:element name="notifications" type="tNotifications" />
-	<xsd:complexType name="tNotifications">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element ref="notification" maxOccurs="unbounded" />
-				</xsd:sequence>
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:element name="notification" type="tNotification" />
-	<xsd:complexType name="tNotification">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:sequence>
-					<xsd:element name="interface" type="tNotificationInterface" />
-					<xsd:element ref="priority" minOccurs="0" />
-					<xsd:element ref="peopleAssignments" />
-					<xsd:element name="presentationElements" type="tPresentationElements" />
-					<xsd:element name="renderings" type="tRenderings"
-						minOccurs="0" />
-				</xsd:sequence>
-				<xsd:attribute name="name" type="xsd:NCName" use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tNotificationInterface">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleElements">
-				<xsd:attribute name="portType" type="xsd:QName" use="required" />
-				<xsd:attribute name="operation" type="xsd:NCName" use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-<!-- miscellaneous helper types -->
-	<xsd:complexType name="tText" mixed="true">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleMixedContentElements">
-				<xsd:attribute ref="xml:lang" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tDescription" mixed="true">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleMixedContentElements">
-				<xsd:attribute ref="xml:lang" />
-				<xsd:attribute name="contentType" type="xsd:string" />
-<!-- any MIME type is allowed as value of contentType -->
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tFrom" mixed="true">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleMixedContentElements">
-				<xsd:sequence>
-					<xsd:choice>
-						<xsd:element name="argument" type="tArgument"
-							minOccurs="0" />
-						<xsd:element name="literal" type="tLiteral" minOccurs="0" />
-					</xsd:choice>
-				</xsd:sequence>
-				<xsd:attribute name="expressionLanguage" type="xsd:anyURI" />
-				<xsd:attribute name="logicalPeopleGroup" type="xsd:QName" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tArgument">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleMixedContentElements">
-				<xsd:attribute name="name" type="xsd:NCName" />
-				<xsd:attribute name="expressionLanguage" type="xsd:anyURI" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tParameter" mixed="true">
-		<xsd:complexContent>
-			<xsd:extension base="tExtensibleMixedContentElements">
-				<xsd:attribute name="name" type="xsd:NCName" use="required" />
-				<xsd:attribute name="type" type="xsd:QName" use="required" />
-			</xsd:extension>
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tLiteral" mixed="true">
-		<xsd:sequence>
-			<xsd:any namespace="##any" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:anyAttribute namespace="##other"
-			processContents="lax" />
-	</xsd:complexType>
-	<xsd:complexType name="tQuery" mixed="true">
-		<xsd:sequence>
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:attribute name="part" />
-		<xsd:attribute name="queryLanguage" type="xsd:anyURI" />
-		<xsd:anyAttribute namespace="##other"
-			processContents="lax" />
-	</xsd:complexType>
-	<xsd:complexType name="tExpression" mixed="true">
-		<xsd:sequence>
-			<xsd:any namespace="##other" processContents="lax" minOccurs="0"
-				maxOccurs="unbounded" />
-		</xsd:sequence>
-		<xsd:attribute name="expressionLanguage" type="xsd:anyURI" />
-		<xsd:anyAttribute namespace="##other"
-			processContents="lax" />
-	</xsd:complexType>
-	<xsd:complexType name="tPriority" mixed="true">
-		<xsd:complexContent mixed="true">
-			<xsd:extension base="tExpression" />
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tBoolean-expr" mixed="true">
-		<xsd:complexContent mixed="true">
-			<xsd:extension base="tExpression" />
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tDuration-expr" mixed="true">
-		<xsd:complexContent mixed="true">
-			<xsd:extension base="tExpression" />
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:complexType name="tDeadline-expr" mixed="true">
-		<xsd:complexContent mixed="true">
-			<xsd:extension base="tExpression" />
-		</xsd:complexContent>
-	</xsd:complexType>
-	<xsd:simpleType name="tBoolean">
-		<xsd:restriction base="xsd:string">
-			<xsd:enumeration value="yes" />
-			<xsd:enumeration value="no" />
-		</xsd:restriction>
-	</xsd:simpleType>
-</xsd:schema>
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/BaseTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/BaseTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/BaseTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -12,6 +12,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
@@ -37,6 +38,7 @@
 import org.drools.task.TaskData;
 import org.drools.task.User;
 import org.drools.task.query.TaskSummary;
+import org.drools.task.service.SendIcal;
 import org.drools.task.service.TaskService;
 import org.drools.task.service.TaskServiceSession;
 import org.drools.task.utils.CollectionUtils;
@@ -60,6 +62,14 @@
     protected TaskServiceSession   taskSession;
 
     protected void setUp() throws Exception {
+        Properties conf = new Properties();
+        conf.setProperty( "mail.smtp.host", "localhost" );
+        conf.setProperty( "mail.smtp.port", "2345" );
+        conf.setProperty( "from", "from at domain.com" );
+        conf.setProperty( "replyTo", "replyTo at domain.com" );
+        conf.setProperty( "defaultLanguage", "en-UK" );
+        SendIcal.initInstance( conf );
+        
         // Use persistence.xml configuration
         emf = Persistence.createEntityManagerFactory( "org.drools.task" );
 
@@ -116,53 +126,12 @@
 
         ParserContext context = new ParserContext();
         context.addPackageImport( "org.drools.task" );
+        context.addPackageImport( "org.drools.task.service" );
+        context.addPackageImport( "org.drools.task.query" );
         context.addPackageImport( "java.util" );
-
-        context.addImport( "AccessType",
-                           AccessType.class );
-        context.addImport( "Allowed",
-                           Allowed.class );
-        context.addImport( "Attachment",
-                           Attachment.class );
-        context.addImport( "BooleanExpression",
-                           BooleanExpression.class );
-        context.addImport( "Comment",
-                           Comment.class );
-        context.addImport( "Deadline",
-                           Deadline.class );
-        context.addImport( "Deadlines",
-                           Deadlines.class );
-        context.addImport( "Delegation",
-                           Delegation.class );
-        context.addImport( "Escalation",
-                           Escalation.class );
-        context.addImport( "EmailNotification",
-                           EmailNotification.class );
-        context.addImport( "EmailNotificationHeader",
-                           EmailNotificationHeader.class );
-        context.addImport( "Group",
-                           Group.class );
-        context.addImport( "I18NText",
-                           I18NText.class );
-        context.addImport( "Notification",
-                           Notification.class );
-        context.addImport( "OrganizationalEntity",
-                           OrganizationalEntity.class );
-        context.addImport( "PeopleAssignments",
-                           PeopleAssignments.class );
-        context.addImport( "Reassignment",
-                           Reassignment.class );
-        context.addImport( "Status",
-                           Status.class );
-        context.addImport( "Task",
-                           Task.class );
-        context.addImport( "TaskData",
-                           TaskData.class );
-        context.addImport( "TaskSummary",
-                           TaskSummary.class );
-        context.addImport( "User",
-                           User.class );
-
+        
+        vars.put( "now",
+                  new Date() );
         return MVEL.executeExpression( compiler.compile( context ),
                                        vars );
     }

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/ModelPersistenceTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/ModelPersistenceTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/ModelPersistenceTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -172,7 +172,7 @@
 
         Delegation delegation = new Delegation();
         task1.setDelegation( delegation );
-        delegation.setAllowed( Allowed.PotentialOwners );
+        delegation.setAllowed( AllowedToDelegate.PotentialOwners );
 
         List<OrganizationalEntity> delegates = new ArrayList<OrganizationalEntity>();
         delegation.setDelegates( delegates );

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/QueryTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/QueryTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/QueryTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -43,6 +43,7 @@
 import org.drools.task.service.EscalatedDeadlineHandler;
 import org.drools.task.service.TaskService;
 import org.drools.task.service.TaskServiceSession;
+import org.drools.task.service.TaskServiceEscalationTest.MockEscalatedDeadlineHandler;
 import org.drools.task.utils.CollectionUtils;
 import org.mvel.MVEL;
 import org.mvel.ParserContext;
@@ -59,16 +60,16 @@
 public class QueryTest extends BaseTest {
 
     public void testUnescalatedDeadlines() throws Exception {
+        MockEscalatedDeadlineHandler handler = new MockEscalatedDeadlineHandler();
+        taskService.setEscalatedDeadlineHandler( handler );
         TaskServiceSession taskSession = taskService.createSession();        
         Map vars = new HashedMap();
         vars.put( "users",
                   users );
         vars.put( "groups",
                   groups );
-        long now = System.currentTimeMillis();
-        vars.put( "now",
-                  now );
 
+
         //Reader reader;
         Reader reader = new InputStreamReader( getClass().getResourceAsStream( "QueryData_UnescalatedDeadlines.mvel" ) );
         List<Task> tasks = (List<Task>) eval( reader,
@@ -76,23 +77,25 @@
         for ( Task task : tasks ) {
             taskSession.addTask( task );
         }
-
+        long now = ((Date)vars.get( "now" )).getTime();
+        
         // should be three, one is marked as escalated
         List<DeadlineSummary> list = taskSession.getUnescalatedDeadlines();
+        
         assertEquals( 3,
                       list.size() );
 
         DeadlineSummary result = list.get( 0 );
-        assertEquals( result.getDate().getTime(),
-                      now + 4000 );
+        assertEquals( now + 20000,
+                      result.getDate().getTime() );
 
         result = list.get( 1 );
-        assertEquals( result.getDate().getTime(),
-                      now + 4500 );
+        assertEquals( now + 22000 ,
+                      result.getDate().getTime() );
 
         result = list.get( 2 );
-        assertEquals( result.getDate().getTime(),
-                      now + 5000 );    
+        assertEquals( now + 24000,
+                      result.getDate().getTime());    
         taskSession.dispose();
     }
     

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/AbstractBlockingResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/AbstractBlockingResponseHandler.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/AbstractBlockingResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,54 @@
+/**
+ * 
+ */
+package org.drools.task.service;
+
+import org.drools.task.service.BaseMinaHandler.ResponseHandler;
+import org.drools.task.service.TaskClientHandler.AddCommentResponseHandler;
+
+public abstract class AbstractBlockingResponseHandler
+    implements
+    ResponseHandler {
+    protected volatile Boolean done = Boolean.FALSE;
+    private String error;
+    
+    public boolean hasError() {
+        return error != null;
+    }
+
+    public String getError() {
+        return error;
+    }
+
+    public void setError(String error) {
+        this.error = error;
+    }
+
+    public boolean isDone() {
+        synchronized ( done ) {
+            return done;
+        }
+    }
+
+    public boolean waitTillDone(long time) {
+        long totalWaitTime = 0;
+        try {
+            while ( true ) {
+                synchronized ( done ) {
+                    if ( done ) {
+                        return true;
+                    }
+                }
+                if ( totalWaitTime >= time ) {
+                    break;
+                }
+                Thread.sleep( 250 );
+                totalWaitTime += 250;
+            }
+        } catch ( Exception e ) {
+            // swallow, as we are either true or false
+        }
+        return false;
+    }
+
+}
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddAttachmentResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddAttachmentResponseHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddAttachmentResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -5,28 +5,35 @@
 
 import org.drools.task.service.TaskClientHandler.AddAttachmentResponseHandler;
 
-public class BlockingAddAttachmentResponseHandler implements AddAttachmentResponseHandler {
+public class BlockingAddAttachmentResponseHandler extends AbstractBlockingResponseHandler implements AddAttachmentResponseHandler {
     private volatile long attachmentId ;
     private volatile long contentId;
-    private volatile boolean wait = true;
 
     public synchronized void execute(long attachmentId, long contentId) {
-        this.attachmentId = attachmentId;
-        this.contentId = contentId;
-        wait = false;
-        notifyAll();                
+        synchronized ( this.done ) {        
+            this.attachmentId = attachmentId;
+            this.contentId = contentId;
+            this.done = true;
+            notifyAll();     
+        }
     }
     
     public synchronized long getAttachmentId() {
-        if ( wait ) {                  
+        boolean isDone;
+        synchronized ( done ) {
+            isDone = this.done;
+        }
+        if ( !isDone ) {                  
             try {
-                wait( 3000 );
+                wait( 10000 );
             } catch ( InterruptedException e ) {
-                // swallow as this is just a notifiation
+                // swallow as this is just a notification
             }
-        }
-        
-        if ( wait ) {
+        }        
+        synchronized ( done ) {
+            isDone = this.done;
+        }        
+        if ( !isDone ) {
             throw new RuntimeException("Timeout : unable to retrieve Attachment Id" );
         }
         
@@ -34,15 +41,21 @@
     }       
     
     public synchronized long getContentId() {
-        if ( wait ) {                  
+        boolean isDone;
+        synchronized ( done ) {
+            isDone = this.done;
+        }
+        if ( !isDone ) {                  
             try {
                 wait( 3000 );
             } catch ( InterruptedException e ) {
-                // swallow as this is just a notifiation
+                // swallow as this is just a notification
             }
-        }
-        
-        if ( wait ) {
+        }        
+        synchronized ( done ) {
+            isDone = this.done;
+        }        
+        if ( !isDone ) {
             throw new RuntimeException("Timeout : unable to retrieve Attachment Content Id" );
         }
         

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddCommentResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddCommentResponseHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddCommentResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -5,29 +5,38 @@
 
 import org.drools.task.service.TaskClientHandler.AddCommentResponseHandler;
 
-public class BlockingAddCommentResponseHandler implements AddCommentResponseHandler {
-    private volatile long commentId;
-    private volatile boolean wait = true;
+public class BlockingAddCommentResponseHandler extends AbstractBlockingResponseHandler
+    implements
+    AddCommentResponseHandler {
+    private volatile long    commentId;
 
     public synchronized void execute(long commentId) {
-        this.commentId = commentId;
-        wait = false;
-        notifyAll();                
+        synchronized ( this.done ) {
+            this.commentId = commentId;
+            this.done = true;
+            notifyAll();
+        }
     }
-    
+
     public synchronized long getCommentId() {
-        if ( wait ) {                  
+        boolean isDone;
+        synchronized ( done ) {
+            isDone = this.done;
+        }
+        if ( !isDone ) {                  
             try {
-                wait( 3000 );
+                wait( 10000 );
             } catch ( InterruptedException e ) {
-                // swallow as this is just a notifiation
+                // swallow as this is just a notification
             }
+        }        
+        synchronized ( done ) {
+            isDone = this.done;
+        }        
+        if ( !isDone ) {
+            throw new RuntimeException( "Timeout : unable to retrieve Task Id" );
         }
-        
-        if ( wait ) {
-            throw new RuntimeException("Timeout : unable to retrieve Task Id" );
-        }
-        
+
         return commentId;
-    }       
+    }
 }
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddTaskResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddTaskResponseHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingAddTaskResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -5,26 +5,33 @@
 
 import org.drools.task.service.TaskClientHandler.AddTaskResponseHandler;
 
-public class BlockingAddTaskResponseHandler implements AddTaskResponseHandler {
+public class BlockingAddTaskResponseHandler extends AbstractBlockingResponseHandler implements AddTaskResponseHandler {
     private volatile long taskId;
-    private volatile boolean wait = true;
 
     public synchronized void execute(long taskId) {
-        this.taskId = taskId;
-        wait = false;
-        notifyAll();                
+        synchronized ( this.done ) {        
+            this.taskId = taskId;
+            this.done = true;
+            notifyAll(); 
+        }
     }
     
     public synchronized long getTaskId() {
-        if ( wait ) {                  
+        boolean isDone;
+        synchronized ( done ) {
+            isDone = this.done;
+        }
+        if ( !isDone ) {                  
             try {
-                wait( 3000 );
+                wait( 10000 );
             } catch ( InterruptedException e ) {
-                // swallow as this is just a notifiation
+                // swallow as this is just a notification
             }
-        }
-        
-        if ( wait ) {
+        }        
+        synchronized ( done ) {
+            isDone = this.done;
+        }        
+        if ( !isDone ) {
             throw new RuntimeException("Timeout : unable to retrieve Task Id" );
         }
         

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteAttachmentResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteAttachmentResponseHandler.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteAttachmentResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,17 @@
+/**
+ * 
+ */
+package org.drools.task.service;
+
+import org.drools.eventmessaging.EventResponseHandler;
+import org.drools.eventmessaging.Payload;
+import org.drools.task.service.TaskClientHandler.DeleteAttachmentResponseHandler;
+import org.drools.task.service.TaskClientHandler.TaskOperationResponseHandler;
+
+public class BlockingDeleteAttachmentResponseHandler extends AbstractBlockingResponseHandler implements DeleteAttachmentResponseHandler {
+      public void setIsDone(boolean done) {
+          synchronized ( this.done ) {
+            this.done = done;
+        }
+      }
+}
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteCommentResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteCommentResponseHandler.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingDeleteCommentResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,17 @@
+/**
+ * 
+ */
+package org.drools.task.service;
+
+import org.drools.eventmessaging.EventResponseHandler;
+import org.drools.eventmessaging.Payload;
+import org.drools.task.service.TaskClientHandler.DeleteCommentResponseHandler;
+import org.drools.task.service.TaskClientHandler.TaskOperationResponseHandler;
+
+public class BlockingDeleteCommentResponseHandler extends AbstractBlockingResponseHandler implements DeleteCommentResponseHandler {
+      public void setIsDone(boolean done) {
+          synchronized ( this.done ) {
+            this.done = done;
+        }
+      }
+}
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingEventResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingEventResponseHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingEventResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -6,26 +6,33 @@
 import org.drools.eventmessaging.EventResponseHandler;
 import org.drools.eventmessaging.Payload;
 
-public class BlockingEventResponseHandler implements EventResponseHandler {
+public class BlockingEventResponseHandler extends AbstractBlockingResponseHandler implements EventResponseHandler {
     private volatile Payload payload;
-    private volatile boolean wait;
 
     public synchronized void execute(Payload payload) {
-        this.payload = payload;
-        wait = true;
-        notifyAll();                
+        synchronized ( this.done ) {            
+            this.payload = payload;        
+            this.done = true;
+        }
+        notifyAll();        
     }
     
     public synchronized Payload getPayload() {
-        if ( !wait ) {                  
+        boolean isDone;
+        synchronized ( done ) {
+            isDone = this.done;
+        }
+        if ( !isDone ) {                  
             try {
-                wait( 3000 );
+                wait( 10000 );
             } catch ( InterruptedException e ) {
                 // swallow as this is just a notification
             }
-        }
-        
-        if ( !wait ) {
+        }        
+        synchronized ( done ) {
+            isDone = this.done;
+        }        
+        if ( !isDone ) {
             throw new RuntimeException("Timeout : unable to retrieve event payload" );
         }
         

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetContentResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetContentResponseHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetContentResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -6,18 +6,21 @@
 import org.drools.task.Content;
 import org.drools.task.service.TaskClientHandler.GetContentResponseHandler;
 
-public class BlockingGetContentResponseHandler implements GetContentResponseHandler {
+public class BlockingGetContentResponseHandler extends AbstractBlockingResponseHandler implements GetContentResponseHandler {
     private volatile Content content;
 
     public synchronized void execute(Content content) {
-        this.content = content;
-        notifyAll();                
+        synchronized ( this.done ) {        
+            this.content = content;
+            this.done = true;
+            notifyAll();                
+        }
     }
     
     public synchronized Content getContent() {
         if ( content == null ) {                  
             try {
-                wait( 3000 );
+                wait( 10000 );
             } catch ( InterruptedException e ) {
                 // swallow as this is just a notifiation
             }

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetTaskResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetTaskResponseHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingGetTaskResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -6,18 +6,21 @@
 import org.drools.task.Task;
 import org.drools.task.service.TaskClientHandler.GetTaskResponseHandler;
 
-public class BlockingGetTaskResponseHandler implements GetTaskResponseHandler {
+public class BlockingGetTaskResponseHandler extends AbstractBlockingResponseHandler implements GetTaskResponseHandler {
     private volatile Task task;
 
     public synchronized void execute(Task task) {
-        this.task = task;
-        notifyAll();                
+        synchronized ( this.done ) {        
+            this.task = task;
+            this.done = true;
+            notifyAll();     
+        }
     }
     
     public synchronized Task getTask() {
         if ( task == null ) {                  
             try {
-                wait( 3000 );
+                wait( 10000 );
             } catch ( InterruptedException e ) {
                 // swallow as this is just a notifiation
             }

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingSetContentResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingSetContentResponseHandler.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingSetContentResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -5,26 +5,33 @@
 
 import org.drools.task.service.TaskClientHandler.SetDocumentResponseHandler;
 
-public class BlockingSetContentResponseHandler implements SetDocumentResponseHandler {
+public class BlockingSetContentResponseHandler extends AbstractBlockingResponseHandler implements SetDocumentResponseHandler {
     private volatile long contentId;
-    private volatile boolean wait = true;
 
     public synchronized void execute(long contentId) {
-        this.contentId = contentId;
-        wait = false;
-        notifyAll();                
+        synchronized ( this.done ) {        
+            this.contentId = contentId;
+            this.done = true;
+            notifyAll();
+        }
     }    
     
     public synchronized long getContentId() {
-        if ( wait ) {                  
+        boolean isDone;
+        synchronized ( done ) {
+            isDone = this.done;
+        }
+        if ( !isDone ) {                  
             try {
-                wait( 3000 );
+                wait( 10000 );
             } catch ( InterruptedException e ) {
-                // swallow as this is just a notifiation
+                // swallow as this is just a notification
             }
-        }
-        
-        if ( wait ) {
+        }        
+        synchronized ( done ) {
+            isDone = this.done;
+        }        
+        if ( !isDone ) {
             throw new RuntimeException("Timeout : unable to retrieve Content Id" );
         }
         

Added: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingTaskOperationResponseHandler.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingTaskOperationResponseHandler.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/BlockingTaskOperationResponseHandler.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -0,0 +1,16 @@
+/**
+ * 
+ */
+package org.drools.task.service;
+
+import org.drools.eventmessaging.EventResponseHandler;
+import org.drools.eventmessaging.Payload;
+import org.drools.task.service.TaskClientHandler.TaskOperationResponseHandler;
+
+public class BlockingTaskOperationResponseHandler extends AbstractBlockingResponseHandler implements TaskOperationResponseHandler {
+      public void setIsDone(boolean done) {
+          synchronized ( this.done ) {
+            this.done = done;
+        }
+      }
+}
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/DemoTaskService.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/DemoTaskService.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/DemoTaskService.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -10,7 +10,7 @@
 
 import org.apache.commons.collections.map.HashedMap;
 import org.drools.task.AccessType;
-import org.drools.task.Allowed;
+import org.drools.task.AllowedToDelegate;
 import org.drools.task.Attachment;
 import org.drools.task.BaseTest;
 import org.drools.task.BooleanExpression;
@@ -88,7 +88,7 @@
         context.addPackageImport( "java.util" );
         
         context.addImport( "AccessType", AccessType.class );
-        context.addImport( "Allowed", Allowed.class );
+        context.addImport( "AllowedToDelegate", AllowedToDelegate.class );
         context.addImport( "Attachment", Attachment.class );
         context.addImport( "BooleanExpression", BooleanExpression.class );
         context.addImport( "Comment", Comment.class );

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/IcalTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/IcalTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/IcalTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -114,12 +114,13 @@
                         addTaskResponseHandler );
 
         long taskId = addTaskResponseHandler.getTaskId();
-
+        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
         client.claim( taskId,
-                      users.get( "steve" ).getId() );
+                      users.get( "steve" ).getId(),
+                      responseHandler );
+        responseHandler.waitTillDone( 5000 );
 
-        Thread.sleep( 3000 );
-
         assertEquals( 2,
                       wiser.getMessages().size() );
         
@@ -226,11 +227,12 @@
 
         long taskId = addTaskResponseHandler.getTaskId();
 
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
         client.claim( taskId,
-                      users.get( "steve" ).getId() );
+                      users.get( "steve" ).getId(),
+                      responseHandler );
+        responseHandler.waitTillDone( 5000 );
 
-        Thread.sleep( 3000 );
-
         assertEquals( 1,
                       wiser.getMessages().size() );
 
@@ -267,26 +269,6 @@
         assertEqualsIgnoreWhitespace( "SUMMARY:\"Task Start : This is my task subject\"DESCRIPTION:\"This is my task description\"PRIORITY:55END:VEVENTEND:VCALENDAR", content.substring( content.length()-131, content.length()) );
     }    
     
-    private static void assertEqualsIgnoreWhitespace(final String expected,
-                                                     final String actual) {
-        assertEqualsIgnoreWhitespace(expected, actual, 0, actual.length());
-    }
-
-    private static void assertEqualsIgnoreWhitespace(final String expected,
-                                                     final String actual,
-                                                     int beginIndex,
-                                                     int endIndex) {
-        final String cleanExpected = expected.replaceAll( "\\s+",
-                                                          "" ).replaceAll( "\\n", "" ).replaceAll( "\\r", "" );
-        
-        final String cleanActual = actual.substring( beginIndex,
-                                                     endIndex ).replaceAll( "\\s+",
-                                                      "" ).replaceAll( "\\n", "" ).replaceAll( "\\r", "" );
-        System.out.println( cleanActual );
-        assertEquals( cleanExpected,
-                      cleanActual );
-    }
-
     public void testSendWithEndDeadline() throws Exception {
         Map vars = new HashedMap();
         vars.put( "users",
@@ -328,10 +310,12 @@
 
         long taskId = addTaskResponseHandler.getTaskId();
 
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
         client.claim( taskId,
-                      users.get( "steve" ).getId() );
+                      users.get( "steve" ).getId(),
+                      responseHandler );
 
-        Thread.sleep( 3000 );
+        responseHandler.waitTillDone( 5000 );
 
         assertEquals( 1,
                       wiser.getMessages().size() );
@@ -405,15 +389,36 @@
 
         long taskId = addTaskResponseHandler.getTaskId();
 
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
         client.claim( taskId,
-                      users.get( "steve" ).getId() );
+                      users.get( "steve" ).getId(),
+                      responseHandler );
 
-        Thread.sleep( 3000 );
+        responseHandler.waitTillDone( 5000 );
 
         assertEquals( 0,
                       wiser.getMessages().size() );        
-    }    
+    }       
     
+    private static void assertEqualsIgnoreWhitespace(final String expected,
+                                                     final String actual) {
+        assertEqualsIgnoreWhitespace(expected, actual, 0, actual.length());
+    }
+
+    private static void assertEqualsIgnoreWhitespace(final String expected,
+                                                     final String actual,
+                                                     int beginIndex,
+                                                     int endIndex) {
+        final String cleanExpected = expected.replaceAll( "\\s+",
+                                                          "" ).replaceAll( "\\n", "" ).replaceAll( "\\r", "" );
+        
+        final String cleanActual = actual.substring( beginIndex,
+                                                     endIndex ).replaceAll( "\\s+",
+                                                      "" ).replaceAll( "\\n", "" ).replaceAll( "\\r", "" );
+        assertEquals( cleanExpected,
+                      cleanActual );
+    } 
+    
     private static byte[] getBytes(InputStream inputStream) throws Exception {
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream(1024);
         byte[] bytes = new byte[512];

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/MockEventMessagingTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/MockEventMessagingTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/MockEventMessagingTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -43,9 +43,11 @@
         
         EventKey key = new TaskEventKey(TaskClaimedEvent.class, taskId );        
         MockEventTriggerTransport transport = new MockEventTriggerTransport();   
-        taskService.getEventKeys().register( key, transport );        
-        taskSession.claim( taskId, users.get( "darth" ).getId() );        
+        taskService.getEventKeys().register( key, transport );      
         
+        
+        taskSession.taskOperation( Operation.Claim, taskId, users.get( "darth" ).getId(), null );        
+        
         assertEquals( 1, transport.list.size() );
         assertEquals( taskId, ((TaskClaimedEvent) ((Payload) transport.list.get(0)).get()).getTaskId() );
         assertEquals( users.get( "darth" ).getId(), ((TaskClaimedEvent) ((Payload) transport.list.get(0)).get()).getUserId() );

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceCommentsAndAttachmentsTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceCommentsAndAttachmentsTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceCommentsAndAttachmentsTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -23,6 +23,7 @@
 import org.drools.task.Status;
 import org.drools.task.Task;
 import org.drools.task.query.TaskSummary;
+import org.drools.task.service.TaskClientHandler.DeleteCommentResponseHandler;
 import org.drools.task.service.TaskClientHandler.TaskSummaryResponseHandler;
 import org.drools.task.service.TaskServiceEscalationTest.MockEscalatedDeadlineHandler.Item;
 import org.drools.task.service.TaskServiceTest.BlockingAllOpenTasksForUseResponseHandler;
@@ -125,7 +126,9 @@
         comments1.add( comment );
         assertTrue( CollectionUtils.equals( comments1, comments2 ) );
         
-        client.deleteComment( taskId, addCommentResponseHandler.getCommentId() );
+        BlockingDeleteCommentResponseHandler deleteCommentResponseHandler = new BlockingDeleteCommentResponseHandler();
+        client.deleteComment( taskId, addCommentResponseHandler.getCommentId(), deleteCommentResponseHandler );
+        deleteCommentResponseHandler.waitTillDone( 3000 );
         
         getTaskResponseHandler = new BlockingGetTaskResponseHandler(); 
         client.getTask( taskId, getTaskResponseHandler );
@@ -237,7 +240,9 @@
         attachments1.add( attachment );
         assertTrue( CollectionUtils.equals( attachments2, attachments1 ) );      
         
-        client.deleteAttachment( taskId, addAttachmentResponseHandler.getAttachmentId(), addAttachmentResponseHandler.getContentId() );
+        BlockingDeleteAttachmentResponseHandler deleteCommentResponseHandler = new BlockingDeleteAttachmentResponseHandler();
+        client.deleteAttachment( taskId, addAttachmentResponseHandler.getAttachmentId(), addAttachmentResponseHandler.getContentId(), deleteCommentResponseHandler );
+        deleteCommentResponseHandler.waitTillDone( 3000 );
         
         Thread.sleep( 3000 );
         

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceDeadlinesTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceDeadlinesTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceDeadlinesTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -9,6 +9,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeMessage;
@@ -45,19 +46,21 @@
 public class TaskServiceDeadlinesTest extends BaseTest {
     MinaTaskServer server;
     MinaTaskClient client;
+    Properties conf;
     
-    String emailHost;
-    String emailPort;
-    
     Wiser wiser;
 
     @Override
     protected void setUp() throws Exception {        
         super.setUp();
-        ChainedProperties props = new ChainedProperties( "process.email.conf" );
-        emailHost = props.getProperty( "host", "locahost" );
-        emailPort = props.getProperty( "port", "2345" );
         
+        conf = new Properties();
+        conf.setProperty( "mail.smtp.host", "localhost" );
+        conf.setProperty( "mail.smtp.port", "2345" );
+        conf.setProperty( "from", "from at domain.com" );
+        conf.setProperty( "replyTo", "replyTo at domain.com" );
+        conf.setProperty( "defaultLanguage", "en-UK" );
+        
         server = new MinaTaskServer( taskService );
         Thread thread = new Thread( server );
         thread.start();
@@ -72,8 +75,8 @@
                         address );
         
         wiser = new Wiser();
-        wiser.setHostname( emailHost );
-        wiser.setPort( Integer.parseInt( emailPort ) );        
+        wiser.setHostname( conf.getProperty( "mail.smtp.host" ) );
+        wiser.setPort( Integer.parseInt( conf.getProperty( "mail.smtp.port" ) ) );        
         wiser.start();
     }
 
@@ -91,8 +94,7 @@
         vars.put( "groups", groups );
         vars.put( "now", new Date() ); 
         
-        DefaultEscalatedDeadlineHandler notificationHandler = new DefaultEscalatedDeadlineHandler();
-        notificationHandler.getHandler().setConnection( emailHost, emailPort, null, null );
+        DefaultEscalatedDeadlineHandler notificationHandler = new DefaultEscalatedDeadlineHandler( conf );
         WorkItemManager manager = new DefaultWorkItemManager( null );
         notificationHandler.setManager( manager );
         
@@ -126,8 +128,13 @@
         // nor yet
         assertEquals(0, wiser.getMessages().size() );     
         
-        Thread.sleep( 6000 );
+        long time = 0;
+        while ( wiser.getMessages().size() != 2 && time < 15000 ) {
+            Thread.sleep( 500 );
+            time += 500;
+        }
         
+        
         // 1 email with two recipients should now exist
         assertEquals(2, wiser.getMessages().size() );        
         
@@ -154,8 +161,7 @@
         vars.put( "groups", groups );
         vars.put( "now", new Date() ); 
         
-        DefaultEscalatedDeadlineHandler notificationHandler = new DefaultEscalatedDeadlineHandler();
-        notificationHandler.getHandler().setConnection( "localhost", "25", null, null );
+        DefaultEscalatedDeadlineHandler notificationHandler = new DefaultEscalatedDeadlineHandler(conf);
         WorkItemManager manager = new DefaultWorkItemManager( null );
         notificationHandler.setManager( manager );
         
@@ -194,7 +200,12 @@
         assertTrue( ids.contains( users.get( "luke" ).getId() ));        
         
         // should have re-assigned by now
-        Thread.sleep( 6000 );     
+        long time = 0;
+        while ( wiser.getMessages().size() != 2 && time < 15000 ) {
+            Thread.sleep( 500 );
+            time += 500;
+        }
+        
         getTaskHandler = new BlockingGetTaskResponseHandler(); 
         client.getTask( taskId, getTaskHandler );
         task = getTaskHandler.getTask();

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEscalationTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEscalationTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEscalationTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -2,6 +2,8 @@
 
 import java.io.InputStreamReader;
 import java.io.Reader;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -10,19 +12,37 @@
 import javax.persistence.EntityManager;
 
 import org.apache.commons.collections.map.HashedMap;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.drools.task.BaseTest;
 import org.drools.task.Deadline;
 import org.drools.task.Task;
 import org.drools.task.service.TaskServiceEscalationTest.MockEscalatedDeadlineHandler.Item;
 
 public class TaskServiceEscalationTest extends BaseTest {
+    MinaTaskServer server;
+    MinaTaskClient client;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
+        server = new MinaTaskServer( taskService );
+        Thread thread = new Thread( server );
+        thread.start();
+        Thread.sleep( 500 );
+
+        client = new MinaTaskClient( "client 1",
+                                     new TaskClientHandler() );
+        NioSocketConnector connector = new NioSocketConnector();
+        SocketAddress address = new InetSocketAddress( "127.0.0.1",
+                                                       9123 );
+        client.connect( connector,
+                        address );
     }
 
     protected void tearDown() throws Exception {
         super.tearDown();
+        client.disconnect();
+        server.stop();
     }
 
     public void testUnescalatedDeadlines() throws Exception {
@@ -31,36 +51,37 @@
                   users );
         vars.put( "groups",
                   groups );
-        long now = System.currentTimeMillis();
-        vars.put( "now",
-                  now );
 
         MockEscalatedDeadlineHandler handler = new MockEscalatedDeadlineHandler();
-        taskService.setEscalatedDeadlineHandler( handler );
-
+        taskService.setEscalatedDeadlineHandler( handler );  
+        
         //Reader reader;
         Reader reader = new InputStreamReader( getClass().getResourceAsStream( "../QueryData_UnescalatedDeadlines.mvel" ) );
         List<Task> tasks = (List<Task>) eval( reader,
                                               vars );
-        for ( Task task : tasks ) {
-            taskSession.addTask( task );
+        long now = ((Date)vars.get( "now" )).getTime();
+        
+        for ( Task task : tasks ) {  
+            BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();            
+            client.addTask( task, addTaskResponseHandler ); 
+            addTaskResponseHandler.waitTillDone( 3000 );
         }
 
-        Thread.sleep( 4000 );
+        handler.wait( 3, 30000 );
         
         assertEquals( 3, handler.list.size() );
-
-        Item item0 = handler.list.get( 0 );
-        assertEquals( item0.getDeadline().getDate().getTime(),
-                      now + 4000 );
         
+        Item item0 = handler.list.get( 0 );        
+        assertEquals( now + 20000,
+                      item0.getDeadline().getDate().getTime() );
+        
         Item item1 = handler.list.get( 1 );
-        assertEquals( item1.getDeadline().getDate().getTime(),
-                      now + 4500 );
+        assertEquals( now + 22000,
+                      item1.getDeadline().getDate().getTime() );
         
         Item item2 = handler.list.get( 2 );
-        assertEquals( item2.getDeadline().getDate().getTime(),
-                      now + 5000 );        
+        assertEquals( now + 24000,
+                      item2.getDeadline().getDate().getTime() );        
     }
     
     public void testUnescalatedDeadlinesOnStartup() throws Exception {
@@ -69,16 +90,12 @@
                   users );
         vars.put( "groups",
                   groups );
-        long now = System.currentTimeMillis();
-        vars.put( "now",
-                  now );
 
-
-
         //Reader reader;
         Reader reader = new InputStreamReader( getClass().getResourceAsStream( "../QueryData_UnescalatedDeadlines.mvel" ) );
         List<Task> tasks = (List<Task>) eval( reader,
                                               vars );
+        long now = ((Date)vars.get( "now" )).getTime();
         
         EntityManager em = emf.createEntityManager();
         em.getTransaction().begin();
@@ -89,26 +106,24 @@
         em.getTransaction().commit();
 
         // now create a new service, to see if it initiates from the DB correctly
-        TaskService local = new TaskService(emf);      
-        
         MockEscalatedDeadlineHandler handler = new MockEscalatedDeadlineHandler();
-        local.setEscalatedDeadlineHandler( handler );
+        TaskService local = new TaskService(emf, handler);      
+                
+        handler.wait( 3, 30000 );
         
-        Thread.sleep( 4000 );
-        
         assertEquals( 3, handler.list.size() );
 
         Item item0 = handler.list.get( 0 );
         assertEquals( item0.getDeadline().getDate().getTime(),
-                      now + 4000 );
+                      now + 20000 );
         
         Item item1 = handler.list.get( 1 );
         assertEquals( item1.getDeadline().getDate().getTime(),
-                      now + 4500 );
+                      now + 22000 );
         
         Item item2 = handler.list.get( 2 );
         assertEquals( item2.getDeadline().getDate().getTime(),
-                      now + 5000 );            
+                      now + 24000 );            
     }
 
     public static class MockEscalatedDeadlineHandler
@@ -177,9 +192,30 @@
 
             public void setEm(EntityManager em) {
                 this.em = em;
+            }                        
+        }   
+        
+        public synchronized void wait(int totalSize, int totalWait) {
+            int wait = 0;
+            int size = 0;
+            
+            while ( true ) {
+                synchronized ( list ) {
+                    size = list.size();
+                }
+                
+                if ( size >= totalSize || wait >= totalWait ) {
+                    break;
+                }
+                
+                try {
+                    Thread.sleep( 250 );
+                } catch( Exception e ) {
+                    throw new RuntimeException( "Unable to sleep", e);
+                }
+                wait += 250;
             }
-            
-            
         }
     }
+    
 }

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEventMessagingTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEventMessagingTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceEventMessagingTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -87,11 +87,11 @@
         EventKey key = new TaskEventKey(TaskClaimedEvent.class, taskId );           
         BlockingEventResponseHandler handler = new BlockingEventResponseHandler(); 
         client.registerForEvent( key, true, handler );
+        Thread.sleep( 3000 );
         
-        taskSession.claim( taskId, users.get( "darth" ).getId() );  
+        taskSession.taskOperation( Operation.Claim, taskId, users.get( "darth" ).getId(), null );          
+        handler.waitTillDone( 5000 );
         
-        Thread.sleep( 2000 );
-        
         Payload payload = handler.getPayload();
         TaskClaimedEvent event = ( TaskClaimedEvent ) payload.get();
         assertNotNull( event );        

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceLifeCycleTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceLifeCycleTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceLifeCycleTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -112,7 +112,7 @@
         assertEquals( users.get( "bobba" ), task1.getTaskData().getActualOwner() );
     }
     
-    public void testClaimWithMultiplePotentialOwners() {
+    public void testClaimWithMultiplePotentialOwners() throws Exception {
         Map  vars = new HashedMap();     
         vars.put( "users", users );
         vars.put( "groups", groups );        
@@ -135,7 +135,9 @@
         Task task1 = getTaskResponseHandler.getTask();
         assertEquals( Status.Ready , task1.getTaskData().getStatus() );     
         
-        client.claim( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );        
+        responseHandler.waitTillDone( 3000 );
         
         getTaskResponseHandler = new BlockingGetTaskResponseHandler(); 
         client.getTask( taskId, getTaskResponseHandler );
@@ -168,7 +170,9 @@
         assertEquals( Status.Ready , task1.getTaskData().getStatus() );     
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
         
         getTaskResponseHandler = new BlockingGetTaskResponseHandler(); 
         client.getTask( taskId, getTaskResponseHandler );
@@ -201,7 +205,9 @@
         assertEquals( Status.Ready , task1.getTaskData().getStatus() );     
         
         // State should not change as user isn't potential owner
-        client.start( taskId, users.get( "tony" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "tony" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
         
         getTaskResponseHandler = new BlockingGetTaskResponseHandler(); 
         client.getTask( taskId, getTaskResponseHandler );
@@ -235,7 +241,10 @@
         assertEquals( users.get( "bobba" ), task1.getTaskData().getActualOwner() );
         
         // Should change to InProgress
-        client.start( taskId, users.get( "bobba" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "bobba" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler(); 
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -268,7 +277,10 @@
         assertEquals( users.get( "bobba" ), task1.getTaskData().getActualOwner() );
         
         // Should change not change
-        client.start( taskId, users.get( "tony" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "tony" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler(); 
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -294,7 +306,8 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -302,7 +315,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );        
         
         // Now Stop
-        client.stop( taskId, users.get( "darth" ).getId() );
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.stop( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -328,7 +344,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -336,7 +355,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );        
         
         // Should not stop
-        client.stop( taskId, users.get( "bobba" ).getId() );
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.stop( taskId, users.get( "bobba" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -344,7 +366,7 @@
         assertEquals( users.get( "darth" ), task2.getTaskData().getActualOwner() );                
     }   
     
-    public void testReleaseFromInprogress() {
+    public void testReleaseFromInprogress() throws Exception {
         Map  vars = new HashedMap();     
         vars.put( "users", users );
         vars.put( "groups", groups );        
@@ -362,7 +384,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -370,7 +395,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is Released
-        client.release( taskId, users.get( "darth" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.release( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -396,7 +424,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.claim( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -404,7 +435,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is Released
-        client.release( taskId, users.get( "darth" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.release( taskId, users.get( "darth" ).getId(), responseHandler );  
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -430,7 +464,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.claim( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -438,7 +475,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is not changed
-        client.release( taskId, users.get( "bobba" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.release( taskId, users.get( "bobba" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -471,7 +511,10 @@
         assertNull( task1.getTaskData().getActualOwner() );  
         
         // Check is Suspended
-        client.suspend( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.suspend( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -498,7 +541,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Check is Reserved
-        client.claim( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );   
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -506,7 +552,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is Suspended
-        client.suspend( taskId, users.get( "darth" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.suspend( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -533,7 +582,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Check is Reserved
-        client.claim( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -541,7 +593,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is not changed
-        client.suspend( taskId, users.get( "bobba" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.suspend( taskId, users.get( "bobba" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -549,7 +604,6 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );      
     }    
     
-    //////////////////////////
     public void testResumeFromReady() {
         Map  vars = new HashedMap();     
         vars.put( "users", users );
@@ -575,7 +629,10 @@
         assertNull( task1.getTaskData().getActualOwner() );  
         
         // Check is Suspended
-        client.suspend( taskId, users.get( "darth" ).getId() );                  
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.suspend( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -584,7 +641,10 @@
         assertNull( task1.getTaskData().getActualOwner() );    
         
         // Check is Resumed
-        client.resume( taskId, users.get( "darth" ).getId() );                  
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.resume( taskId, users.get( "darth" ).getId(), responseHandler );   
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task3 = getTaskResponseHandler.getTask();
@@ -611,7 +671,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Check is Reserved
-        client.claim( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -619,7 +682,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is suspended
-        client.suspend( taskId, users.get( "darth" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.suspend( taskId, users.get( "darth" ).getId(), responseHandler );        
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -628,7 +694,10 @@
         assertEquals( users.get( "darth" ), task2.getTaskData().getActualOwner() ); 
         
         // Check is Resumed
-        client.resume( taskId, users.get( "darth" ).getId() );                  
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.resume( taskId, users.get( "darth" ).getId(), responseHandler ); 
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task3 = getTaskResponseHandler.getTask();
@@ -655,7 +724,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Check is Reserved
-        client.claim( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -663,7 +735,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check not changed
-        client.suspend( taskId, users.get( "bobba" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.suspend( taskId, users.get( "bobba" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -689,11 +764,14 @@
         long taskId = addTaskResponseHandler.getTaskId();                     
         
         // Check is Complete
-        client.skip( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.skip( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
-        assertEquals(  Status.Obselete, task1.getTaskData().getStatus() );
+        assertEquals(  Status.Obsolete, task1.getTaskData().getStatus() );
         assertNull(  task1.getTaskData().getActualOwner() );                  
     }    
     
@@ -715,18 +793,250 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready 
-        client.claim( taskId, users.get( "darth" ).getId() );
- 
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
         
         // Check is Complete
-        client.skip( taskId, users.get( "darth" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.skip( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
-        assertEquals(  Status.Obselete, task1.getTaskData().getStatus() );
+        assertEquals(  Status.Obsolete, task1.getTaskData().getStatus() );
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );                  
     }     
     
+    public void testDelegateFromReady() throws Exception {
+        Map  vars = new HashedMap();     
+        vars.put( "users", users );
+        vars.put( "groups", groups );        
+        vars.put( "now", new Date() );
+        
+        // One potential owner, should go straight to state Reserved
+        String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
+        str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [users['bobba' ], users['darth'] ], }),";                        
+        str += "names = [ new I18NText( 'en-UK', 'This is my task name')] })";
+            
+        BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();
+        Task task = ( Task )  eval( new StringReader( str ), vars );
+        client.addTask( task, addTaskResponseHandler );        
+        long taskId = addTaskResponseHandler.getTaskId();                     
+        
+        // Check is Delegated
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.delegate( taskId, users.get( "darth" ).getId(), users.get( "tony" ).getId(), responseHandler );    
+        responseHandler.waitTillDone( 3000 );
+        
+        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );        
+        Task task2 = getTaskResponseHandler.getTask();
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "darth" ) ) );
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "tony" ) ) );
+        assertEquals( users.get( "tony" ), task2.getTaskData().getActualOwner() );
+        assertEquals(  Status.Ready, task2.getTaskData().getStatus() );             
+    }     
+    
+    public void testDelegateFromReserved() throws Exception {
+        Map  vars = new HashedMap();     
+        vars.put( "users", users );
+        vars.put( "groups", groups );        
+        vars.put( "now", new Date() );
+        
+        // One potential owner, should go straight to state Reserved
+        String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
+        str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [users['bobba' ], users['darth'] ], }),";                        
+        str += "names = [ new I18NText( 'en-UK', 'This is my task name')] })";
+            
+        BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();
+        Task task = ( Task )  eval( new StringReader( str ), vars );
+        client.addTask( task, addTaskResponseHandler );
+        
+        long taskId = addTaskResponseHandler.getTaskId();             
+        
+        // Claim and Reserved
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
+        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );
+        Task task1 = getTaskResponseHandler.getTask();
+        assertEquals(  Status.Reserved, task1.getTaskData().getStatus() );
+        assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
+        
+        // Check is Delegated
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.delegate( taskId, users.get( "darth" ).getId(), users.get( "tony" ).getId(), responseHandler );    
+        responseHandler.waitTillDone( 3000 );
+        
+        getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );        
+        Task task2 = getTaskResponseHandler.getTask();
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "darth" ) ) );
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "tony" ) ) );
+        assertEquals( users.get( "tony" ), task2.getTaskData().getActualOwner() );
+        assertEquals(  Status.Ready, task2.getTaskData().getStatus() );             
+    }     
+    
+    public void testDelegateFromReservedWithIncorrectUser() throws Exception {
+        Map  vars = new HashedMap();     
+        vars.put( "users", users );
+        vars.put( "groups", groups );        
+        vars.put( "now", new Date() );
+        
+        // One potential owner, should go straight to state Reserved
+        String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
+        str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [users['bobba' ], users['darth'] ], }),";                        
+        str += "names = [ new I18NText( 'en-UK', 'This is my task name')] })";
+            
+        BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();
+        Task task = ( Task )  eval( new StringReader( str ), vars );
+        client.addTask( task, addTaskResponseHandler );        
+        long taskId = addTaskResponseHandler.getTaskId();             
+        
+        // Claim and Reserved
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
+        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );
+        Task task1 = getTaskResponseHandler.getTask();
+        assertEquals(  Status.Reserved, task1.getTaskData().getStatus() );
+        assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
+        
+        // Check was not delegated
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.delegate( taskId, users.get( "bobba" ).getId(), users.get( "tony" ).getId(), responseHandler );    
+        responseHandler.waitTillDone( 3000 );
+        
+        getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );        
+        Task task2 = getTaskResponseHandler.getTask();
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "darth" ) ) );
+        assertFalse( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "tony" ) ) );
+        assertEquals( users.get( "darth" ), task2.getTaskData().getActualOwner() );
+        assertEquals(  Status.Reserved, task2.getTaskData().getStatus() );             
+    }  
+    
+    public void testForwardFromReady() throws Exception {
+        Map  vars = new HashedMap();     
+        vars.put( "users", users );
+        vars.put( "groups", groups );        
+        vars.put( "now", new Date() );
+        
+        // One potential owner, should go straight to state Reserved
+        String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
+        str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [users['bobba' ], users['darth'] ], }),";                        
+        str += "names = [ new I18NText( 'en-UK', 'This is my task name')] })";
+            
+        BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();
+        Task task = ( Task )  eval( new StringReader( str ), vars );
+        client.addTask( task, addTaskResponseHandler );
+        
+        long taskId = addTaskResponseHandler.getTaskId();                     
+        
+        // Check is Forwarded
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.forward( taskId, users.get( "darth" ).getId(), users.get( "tony" ).getId(), responseHandler );    
+        responseHandler.waitTillDone( 3000 );
+        
+        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );        
+        Task task2 = getTaskResponseHandler.getTask();
+        assertFalse( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "darth" ) ) );
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "tony" ) ) );
+        assertNull( task2.getTaskData().getActualOwner() );
+        assertEquals(  Status.Ready, task2.getTaskData().getStatus() );             
+    }  
+    
+    public void testForwardFromReserved() throws Exception {
+        Map  vars = new HashedMap();     
+        vars.put( "users", users );
+        vars.put( "groups", groups );        
+        vars.put( "now", new Date() );
+        
+        // One potential owner, should go straight to state Reserved
+        String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
+        str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [users['bobba' ], users['darth'] ], }),";                        
+        str += "names = [ new I18NText( 'en-UK', 'This is my task name')] })";
+            
+        BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();
+        Task task = ( Task )  eval( new StringReader( str ), vars );
+        client.addTask( task, addTaskResponseHandler );
+        
+        long taskId = addTaskResponseHandler.getTaskId();             
+        
+        // Claim and Reserved
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
+        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );
+        Task task1 = getTaskResponseHandler.getTask();
+        assertEquals(  Status.Reserved, task1.getTaskData().getStatus() );
+        assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
+        
+        // Check is Delegated
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.forward( taskId, users.get( "darth" ).getId(), users.get( "tony" ).getId(), responseHandler );    
+        responseHandler.waitTillDone( 3000 );
+        
+        getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );        
+        Task task2 = getTaskResponseHandler.getTask();
+        assertFalse( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "darth" ) ) );
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "tony" ) ) );
+        assertNull( task2.getTaskData().getActualOwner() );
+        assertEquals(  Status.Ready, task2.getTaskData().getStatus() );             
+    }     
+    
+    public void testForwardFromReservedWithIncorrectUser() throws Exception {
+        Map  vars = new HashedMap();     
+        vars.put( "users", users );
+        vars.put( "groups", groups );        
+        vars.put( "now", new Date() );
+        
+        // One potential owner, should go straight to state Reserved
+        String str = "(with (new Task()) { priority = 55, taskData = (with( new TaskData()) { } ), ";
+        str += "peopleAssignments = (with ( new PeopleAssignments() ) { potentialOwners = [users['bobba' ], users['darth'] ], }),";                        
+        str += "names = [ new I18NText( 'en-UK', 'This is my task name')] })";
+            
+        BlockingAddTaskResponseHandler addTaskResponseHandler = new BlockingAddTaskResponseHandler();
+        Task task = ( Task )  eval( new StringReader( str ), vars );
+        client.addTask( task, addTaskResponseHandler );
+        
+        long taskId = addTaskResponseHandler.getTaskId();             
+        
+        // Claim and Reserved
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.claim( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
+        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );
+        Task task1 = getTaskResponseHandler.getTask();
+        assertEquals(  Status.Reserved, task1.getTaskData().getStatus() );
+        assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
+        
+        // Check was not delegated
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.forward( taskId, users.get( "bobba" ).getId(), users.get( "tony" ).getId(), responseHandler );    
+        responseHandler.waitTillDone( 3000 );
+        
+        getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
+        client.getTask( taskId, getTaskResponseHandler );        
+        Task task2 = getTaskResponseHandler.getTask();
+        assertTrue( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "darth" ) ) );
+        assertFalse( task2.getPeopleAssignments().getPotentialOwners().contains( users.get( "tony" ) ) );
+        assertEquals( users.get( "darth" ), task2.getTaskData().getActualOwner() );
+        assertEquals(  Status.Reserved, task2.getTaskData().getStatus() );             
+    }      
+    
     public void testComplete() {
         Map  vars = new HashedMap();     
         vars.put( "users", users );
@@ -745,7 +1055,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -753,7 +1066,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is Complete
-        client.complete( taskId, users.get( "darth" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.complete( taskId, users.get( "darth" ).getId(), responseHandler ); 
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -779,7 +1095,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );        
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -787,7 +1106,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Should not complete as wrong user
-        client.complete( taskId, users.get( "bobba" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.complete( taskId, users.get( "bobba" ).getId(), responseHandler );  
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -813,7 +1135,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -821,7 +1146,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Check is Failed
-        client.fail( taskId, users.get( "darth" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.fail( taskId, users.get( "darth" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();
@@ -847,7 +1175,10 @@
         long taskId = addTaskResponseHandler.getTaskId();             
         
         // Go straight from Ready to Inprogress
-        client.start( taskId, users.get( "darth" ).getId() );        
+        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
+        client.start( taskId, users.get( "darth" ).getId(), responseHandler );      
+        responseHandler.waitTillDone( 3000 );
+        
         BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task1 = getTaskResponseHandler.getTask();
@@ -855,7 +1186,10 @@
         assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() );  
         
         // Should not fail as wrong user
-        client.fail( taskId, users.get( "bobba" ).getId() );        
+        responseHandler = new BlockingTaskOperationResponseHandler();
+        client.fail( taskId, users.get( "bobba" ).getId(), responseHandler );
+        responseHandler.waitTillDone( 3000 );
+        
         getTaskResponseHandler = new BlockingGetTaskResponseHandler();  
         client.getTask( taskId, getTaskResponseHandler );
         Task task2 = getTaskResponseHandler.getTask();

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceTest.java
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceTest.java	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/java/org/drools/task/service/TaskServiceTest.java	2008-09-24 00:21:45 UTC (rev 23031)
@@ -7,6 +7,8 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.transaction.Synchronization;
+
 import org.apache.commons.collections.map.HashedMap;
 import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.drools.task.BaseTest;
@@ -199,6 +201,7 @@
         implements
         TaskSummaryResponseHandler {
         private volatile List<TaskSummary> results;
+        private volatile String error;
 
         public synchronized void execute(List<TaskSummary> results) {
             this.results = results;
@@ -222,6 +225,20 @@
 
         }
 
+        public boolean isDone() {
+            synchronized ( results ) {
+                return results != null;                
+            }
+        }
+
+        public void setError(String error) {
+            this.error = error;            
+        }
+        
+        public String getError() {
+            return error;
+        }
+
     };
 
 }

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/FullyPopulatedTask.mvel
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/FullyPopulatedTask.mvel	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/FullyPopulatedTask.mvel	2008-09-24 00:21:45 UTC (rev 23031)
@@ -58,7 +58,7 @@
     descriptions = [ new I18NText( "en-UK", "This is my task description" ),
                      new I18NText( "en-DK", "Das ist mein task Beschreibung" ) ],
     delegation = ( with( new Delegation() ) {
-        allowed = Allowed.PotentialOwners,
+        allowed = AllowedToDelegate.PotentialOwners,
         delegates = [ groups['crusaders' ], groups['knightsTempler' ] ]                                                                
     }),
     deadlines = ( with ( new Deadlines() ) {

Modified: labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/QueryData_UnescalatedDeadlines.mvel
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/QueryData_UnescalatedDeadlines.mvel	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-process-task/src/test/resources/org/drools/task/QueryData_UnescalatedDeadlines.mvel	2008-09-24 00:21:45 UTC (rev 23031)
@@ -13,7 +13,7 @@
 	    deadlines = ( with ( new Deadlines() ) {
 	        startDeadlines = [ 
 	            (with (new Deadline()) {
-	                date = new Date( now + 4000 ),
+	                date = new Date( now.getTime() + 20000 ),
 	                escalated = false,
 	                escalations = [ 
 	                    (with (new Escalation()) {
@@ -36,7 +36,7 @@
 	        ],
 	        endDeadlines = [ 
 	            (with (new Deadline()) {
-	                date =  new Date( now + 4500 ),
+	                date =  new Date( now.getTime() + 22000 ),
 	                escalated = false,
 	                escalations = [ 
 	                    (with (new Escalation()) {
@@ -71,7 +71,7 @@
 	    deadlines = ( with ( new Deadlines() ) {
 	        startDeadlines = [ 
 	            (with (new Deadline()) {
-	                date = new Date( now - 1000 ),
+	                date = new Date( now.getTime() - 1000 ),
 	                escalated = true,
 	                escalations = [ 
 	                    (with (new Escalation()) {
@@ -94,7 +94,7 @@
 	        ],
 	        endDeadlines = [ 
 	            (with (new Deadline()) {
-	                date =  new Date( now + 5000 ),
+	                date =  new Date( now.getTime() + 24000 ),
 	                escalations = [ 
 	                    (with (new Escalation()) {
 	                        name = "My End Escalation",

Modified: labs/jbossrules/trunk/drools-process/drools-workitems/.classpath
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-workitems/.classpath	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-workitems/.classpath	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,36 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src/main/java"/>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
-	<classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
-	<classpathentry kind="src" path="src/main/resources"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.4/commons-io-1.4.jar"/>
-	<classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"/>
-	<classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-compress/1.0-SNAPSHOT/commons-compress-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-exec/1.0.0-SNAPSHOT/commons-exec-1.0.0-SNAPSHOT.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-finder/1.0-SNAPSHOT/commons-finder-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-cli/2.0-SNAPSHOT/commons-cli-2.0-SNAPSHOT.jar"/>
-	<classpathentry kind="src" path="/drools-compiler"/>
-	<classpathentry kind="src" path="/drools-core"/>
-	<classpathentry kind="var" path="M2_REPO/org/mvel/mvel/2.0-SNAPSHOT/mvel-2.0-SNAPSHOT.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.0.1/antlr-runtime-3.0.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/antlr/gunit/1.0.1/gunit-1.0.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/antlr/antlr/3.0.1/antlr-3.0.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.7/antlr-2.7.7.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.3.v_686_R32x/core-3.2.3.v_686_R32x.jar"/>
-	<classpathentry kind="var" path="M2_REPO/janino/janino/2.5.10/janino-2.5.10.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/jmock/jmock/2.5.0.1/jmock-2.5.0.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/subethamail/subethasmtp-wiser/1.2/subethasmtp-wiser-1.2.jar"/>
-	<classpathentry kind="var" path="M2_REPO/org/subethamail/subethasmtp-smtp/1.2/subethasmtp-smtp-1.2.jar"/>
-	<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar"/>
-	<classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar"/>
-	<classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
-	<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.4/commons-io-1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-compress/1.0-SNAPSHOT/commons-compress-1.0-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-exec/1.0.0-SNAPSHOT/commons-exec-1.0.0-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-finder/1.0-SNAPSHOT/commons-finder-1.0-SNAPSHOT.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-cli/2.0-SNAPSHOT/commons-cli-2.0-SNAPSHOT.jar"/>
+  <classpathentry kind="src" path="/drools-compiler"/>
+  <classpathentry kind="src" path="/drools-core"/>
+  <classpathentry kind="var" path="M2_REPO/org/mvel/mvel/2.0M2/mvel-2.0M2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/antlr/antlr-runtime/3.0.1/antlr-runtime-3.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/core/3.2.3.v_686_R32x/core-3.2.3.v_686_R32x.jar"/>
+  <classpathentry kind="var" path="M2_REPO/janino/janino/2.5.10/janino-2.5.10.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/jmock/jmock/2.5.0.1/jmock-2.5.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/subethamail/subethasmtp-wiser/1.2/subethasmtp-wiser-1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/subethamail/subethasmtp-smtp/1.2/subethasmtp-smtp-1.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar"/>
+  <classpathentry kind="var" path="M2_REPO/logkit/logkit/1.0.1/logkit-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.3/servlet-api-2.3.jar"/>
+</classpath>
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-process/drools-workitems/src/main/resources/META-INF/drools.email.conf
===================================================================
--- labs/jbossrules/trunk/drools-process/drools-workitems/src/main/resources/META-INF/drools.email.conf	2008-09-23 22:56:43 UTC (rev 23030)
+++ labs/jbossrules/trunk/drools-process/drools-workitems/src/main/resources/META-INF/drools.email.conf	2008-09-24 00:21:45 UTC (rev 23031)
@@ -1,8 +1,5 @@
 from = from at domain.com
 replyTo = replyTo at domain.com
-host = localhost
-#host = smtp.corp.redhat.com
-port = 2345
-defaultLanguage = en-UK
-#userName =
-#password =
\ No newline at end of file
+mail.smtp.host = localhost
+mail.smtp.port = 25
+defaultLanguage = en-UK
\ No newline at end of file




More information about the jboss-svn-commits mailing list