incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r.@apache.org
Subject svn commit: r988005 - in /incubator/hise/trunk: hise-services/src/main/java/org/apache/hise/api/ hise-services/src/main/java/org/apache/hise/engine/ hise-services/src/main/java/org/apache/hise/engine/jaxws/ rtests/src/test/java/org/apache/hise/ rtests/...
Date Mon, 23 Aug 2010 07:07:35 GMT
Author: rr
Date: Mon Aug 23 07:07:34 2010
New Revision: 988005

URL: http://svn.apache.org/viewvc?rev=988005&view=rev
Log:
HISE-63: Management API exposed as OSGI service (Thanks to Paweł Byszewski)

Modified:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Management.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/ManagementImpl.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsAdministrative.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java
    incubator/hise/trunk/rtests/src/test/java/org/apache/hise/TaskTestBase.java
    incubator/hise/trunk/rtests/src/test/java/org/apache/hise/managementApi/ManagementApiTest.java
    incubator/hise/trunk/rtests/src/test/resources/test-example/test.xml
    incubator/hise/trunk/rtests/src/test/resources/test-example/testHtd1.xml

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Management.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Management.java?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Management.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/api/Management.java Mon
Aug 23 07:07:34 2010
@@ -18,6 +18,7 @@
  */
 package org.apache.hise.api;
 
+import java.math.BigInteger;
 import java.util.List;
 
 import org.apache.hise.dao.HISEDao;
@@ -28,6 +29,10 @@ import org.apache.hise.engine.wsdl.Recip
 import org.apache.hise.lang.xsd.htd.TOrganizationalEntity;
 import org.apache.hise.lang.xsd.htda.TStatus;
 import org.apache.hise.lang.xsd.htda.TTask;
+import org.apache.hise.lang.xsd.htdt.ActivateDocument;
+import org.apache.hise.lang.xsd.htdt.ActivateResponseDocument;
+import org.apache.hise.lang.xsd.htdt.ClaimDocument;
+import org.apache.hise.lang.xsd.htdt.ClaimResponseDocument;
 import org.apache.hise.lang.xsd.htdt.CompleteDocument;
 import org.apache.hise.lang.xsd.htdt.CompleteResponseDocument;
 import org.apache.hise.lang.xsd.htdt.GetMyTaskAbstractsDocument;
@@ -38,10 +43,21 @@ import org.apache.hise.lang.xsd.htdt.Nom
 import org.apache.hise.lang.xsd.htdt.NominateResponseDocument;
 import org.apache.hise.lang.xsd.htdt.ReleaseDocument;
 import org.apache.hise.lang.xsd.htdt.ReleaseResponseDocument;
+import org.apache.hise.lang.xsd.htdt.RemoveDocument;
+import org.apache.hise.lang.xsd.htdt.RemoveResponseDocument;
+import org.apache.hise.lang.xsd.htdt.ResumeDocument;
+import org.apache.hise.lang.xsd.htdt.ResumeResponseDocument;
+import org.apache.hise.lang.xsd.htdt.SetPriorityDocument;
+import org.apache.hise.lang.xsd.htdt.SetPriorityResponseDocument;
 import org.apache.hise.lang.xsd.htdt.StartDocument;
 import org.apache.hise.lang.xsd.htdt.StartResponseDocument;
 import org.apache.hise.lang.xsd.htdt.StopDocument;
 import org.apache.hise.lang.xsd.htdt.StopResponseDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendResponseDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendUntilDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendUntilResponseDocument;
+import org.apache.hise.lang.xsd.htdt.TTime;
 
 public interface Management {
 
@@ -70,9 +86,29 @@ public interface Management {
 	 public ReleaseResponseDocument release(ReleaseDocument release, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault;
 	 public ReleaseResponseDocument release(Long id, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault;
 
+	 public SuspendResponseDocument suspend(SuspendDocument suspend, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault ;
+	 public SuspendResponseDocument suspend(Long id, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault;	 
+
+	 public SuspendUntilResponseDocument suspendUntil(SuspendUntilDocument suspendUntil, String
name) throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault ;
+	 public SuspendUntilResponseDocument suspendUntil(Long id, TTime time, String name) throws
IllegalArgumentFault, IllegalStateFault, IllegalAccessFault ;
+	 
+	 public RemoveResponseDocument remove(RemoveDocument remove, String name) throws IllegalArgumentFault,
IllegalAccessFault;
+	 public RemoveResponseDocument remove(Long id, String name) throws IllegalArgumentFault,
IllegalAccessFault ;
+	 
+	 public ResumeResponseDocument resume(ResumeDocument resume, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault ;
+	 public ResumeResponseDocument resume(Long id, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault ;
+	 		
+	 public ActivateResponseDocument activate(ActivateDocument activate, String name) throws
IllegalArgumentFault, IllegalStateFault, IllegalAccessFault;
+	 public ActivateResponseDocument activate(Long id, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault;
+		
+	 public ClaimResponseDocument claim(ClaimDocument claim, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault ;
+	 public ClaimResponseDocument claim(Long id, String name) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault ;
+	 
 	 public GetMyTaskAbstractsResponseDocument getMyTaskAbstracts(GetMyTaskAbstractsDocument
getMyTaskAbstracts, String name) throws IllegalArgumentFault, IllegalStateFault;
 	 
 	 public NominateResponseDocument nominate(NominateDocument nominate, String name) throws
IllegalArgumentFault, IllegalStateFault, IllegalAccessFault;
 	
+	 public SetPriorityResponseDocument setPriority(Long id, java.math.BigInteger priority,
String name) throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault;
+	 
 	}
 

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/ManagementImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/ManagementImpl.java?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/ManagementImpl.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/ManagementImpl.java
Mon Aug 23 07:07:34 2010
@@ -19,6 +19,7 @@
 
 package org.apache.hise.engine;
 
+import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -46,6 +47,10 @@ import org.apache.hise.lang.xsd.htda.TSt
 import org.apache.hise.lang.xsd.htda.TTask;
 import org.apache.hise.runtime.HiseIllegalStateException;
 import org.apache.hise.runtime.Task;
+import org.apache.hise.lang.xsd.htdt.ActivateDocument;
+import org.apache.hise.lang.xsd.htdt.ActivateResponseDocument;
+import org.apache.hise.lang.xsd.htdt.ClaimDocument;
+import org.apache.hise.lang.xsd.htdt.ClaimResponseDocument;
 import org.apache.hise.lang.xsd.htdt.CompleteDocument;
 import org.apache.hise.lang.xsd.htdt.CompleteResponseDocument;
 import org.apache.hise.lang.xsd.htdt.GetMyTaskAbstractsDocument;
@@ -56,11 +61,21 @@ import org.apache.hise.lang.xsd.htdt.Nom
 import org.apache.hise.lang.xsd.htdt.NominateResponseDocument;
 import org.apache.hise.lang.xsd.htdt.ReleaseDocument;
 import org.apache.hise.lang.xsd.htdt.ReleaseResponseDocument;
+import org.apache.hise.lang.xsd.htdt.RemoveDocument;
+import org.apache.hise.lang.xsd.htdt.RemoveResponseDocument;
+import org.apache.hise.lang.xsd.htdt.ResumeDocument;
+import org.apache.hise.lang.xsd.htdt.ResumeResponseDocument;
+import org.apache.hise.lang.xsd.htdt.SetPriorityResponseDocument;
 import org.apache.hise.lang.xsd.htdt.StartDocument;
 import org.apache.hise.lang.xsd.htdt.StartResponseDocument;
 import org.apache.hise.lang.xsd.htdt.StopDocument;
 import org.apache.hise.lang.xsd.htdt.StopResponseDocument;
 import org.apache.hise.lang.xsd.htdt.StartDocument.Start;
+import org.apache.hise.lang.xsd.htdt.SuspendDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendResponseDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendUntilDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendUntilResponseDocument;
+import org.apache.hise.lang.xsd.htdt.TTime;
 import org.apache.hise.lang.xsd.htdt.impl.StartDocumentImpl;
 
 public class ManagementImpl implements Management {
@@ -174,9 +189,7 @@ public class ManagementImpl implements M
 		adminOperations.setUserName(name);
 			return adminOperations.start(start);
 	}
-	
-	public StartResponseDocument start(String taskIdentifier, String name)
-	throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	public StartResponseDocument start(String taskIdentifier, String name)throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault {
 		
 		StartDocument startDoc = StartDocument.Factory.newInstance();
 		Start start=Start.Factory.newInstance();
@@ -198,7 +211,6 @@ public class ManagementImpl implements M
 	}
 	public StopResponseDocument stop(String id, String name) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault{
 		adminOperations.setUserName(name);
-		//adminOperations.st
 		return adminOperations.stop(Long.parseLong(id));
 	}
 	
@@ -231,12 +243,12 @@ public class ManagementImpl implements M
 	public GetTaskInfoResponseDocument getTaskInfo(GetTaskInfoDocument getTaskInfo) throws IllegalArgumentFault{
 		 return adminOperations.getTaskInfo(getTaskInfo);
 	 }
-	 
 	public GetTaskInfoResponseDocument getTaskInfo(Long id) throws IllegalArgumentFault{
 		 return adminOperations.getTaskInfo(id);
 	 }
 	
-	 public ReleaseResponseDocument release(ReleaseDocument release, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault{
+	
+     public ReleaseResponseDocument release(ReleaseDocument release, String name) throws
IllegalArgumentFault, IllegalStateFault, IllegalAccessFault{
 		 adminOperations.setUserName(name);
 		 return adminOperations.release(release);
 	 }
@@ -245,15 +257,99 @@ public class ManagementImpl implements M
 		 return adminOperations.release(id);
 	 }
 	 
+	
 	 public GetMyTaskAbstractsResponseDocument getMyTaskAbstracts(GetMyTaskAbstractsDocument
getMyTaskAbstracts, String name) throws IllegalArgumentFault, IllegalStateFault{
 		 adminOperations.setUserName(name);
 		 return adminOperations.getMyTaskAbstracts(getMyTaskAbstracts);
 	 }
 	 
-	 public NominateResponseDocument nominate(NominateDocument nominate, String name) throws
IllegalArgumentFault, IllegalStateFault, IllegalAccessFault{
+	 
+public NominateResponseDocument nominate(NominateDocument nominate, String name) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault{
 		 adminOperations.setUserName(name);
 		 return adminOperations.nominate(nominate);		 
 	 }
+
+public SuspendResponseDocument suspend(SuspendDocument suspend, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	// TODO Auto-generated method stub
+	return null;
+}
+
+public SuspendResponseDocument suspend(Long id, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	 adminOperations.setUserName(name);
+	 return adminOperations.suspend(id);
+}
+
+public SuspendUntilResponseDocument suspendUntil(
+		SuspendUntilDocument suspendUntil, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	// TODO Auto-generated method stub
+	return null;
+}
+
+public SuspendUntilResponseDocument suspendUntil(Long id, TTime time,
+		String name) throws IllegalArgumentFault, IllegalStateFault,
+		IllegalAccessFault {
+	 adminOperations.setUserName(name);
+	 return adminOperations.suspendUntil(id, time);
+}
+
+public RemoveResponseDocument remove(RemoveDocument remove, String name)
+		throws IllegalArgumentFault, IllegalAccessFault {
+	// TODO Auto-generated method stub
+	return null;
+}
+
+public RemoveResponseDocument remove(Long id, String name)
+		throws IllegalArgumentFault, IllegalAccessFault {
+	 adminOperations.setUserName(name);
+	 return adminOperations.remove(id);
+}
+
+public ResumeResponseDocument resume(ResumeDocument resume, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	// TODO Auto-generated method stub
+	return null;
+}
+
+public ResumeResponseDocument resume(Long id, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	 adminOperations.setUserName(name);
+	 return adminOperations.resume(id);
+}
+
+public ActivateResponseDocument activate(ActivateDocument activate, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	// TODO Auto-generated method stub
+	return null;
+}
+
+public ActivateResponseDocument activate(Long id, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	 adminOperations.setUserName(name);
+	 return adminOperations.activate(id);
+}
+
+public ClaimResponseDocument claim(ClaimDocument claim, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	// TODO Auto-generated method stub
+	return null;
+}
+
+public ClaimResponseDocument claim(Long id, String name)
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	 adminOperations.setUserName(name);
+	 return adminOperations.claim(id);
+}
+
+public SetPriorityResponseDocument setPriority(Long id, java.math.BigInteger priority, String
name)   
+		throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault {
+	 adminOperations.setUserName(name);
+	 return adminOperations.setPriority(id, priority);
+}
+
+
 	
 	
 

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsAdministrative.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsAdministrative.java?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsAdministrative.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsAdministrative.java
Mon Aug 23 07:07:34 2010
@@ -1,13 +1,21 @@
 package org.apache.hise.engine.jaxws;
 
+import java.math.BigInteger;
+
 import org.apache.hise.engine.wsdl.IllegalAccessFault;
 import org.apache.hise.engine.wsdl.IllegalArgumentFault;
 import org.apache.hise.engine.wsdl.IllegalStateFault;
 import org.apache.hise.engine.wsdl.TaskOperations;
+import org.apache.hise.lang.xsd.htdt.ActivateResponseDocument;
+import org.apache.hise.lang.xsd.htdt.ClaimResponseDocument;
 import org.apache.hise.lang.xsd.htdt.GetTaskInfoResponseDocument;
 import org.apache.hise.lang.xsd.htdt.ReleaseResponseDocument;
 import org.apache.hise.lang.xsd.htdt.RemoveResponseDocument;
+import org.apache.hise.lang.xsd.htdt.ResumeResponseDocument;
+import org.apache.hise.lang.xsd.htdt.SetPriorityDocument;
+import org.apache.hise.lang.xsd.htdt.SetPriorityResponseDocument;
 import org.apache.hise.lang.xsd.htdt.StopResponseDocument;
+import org.apache.hise.lang.xsd.htdt.SuspendResponseDocument;
 import org.apache.hise.lang.xsd.htdt.SuspendUntilResponseDocument;
 import org.apache.hise.lang.xsd.htdt.TTime;
 
@@ -20,4 +28,9 @@ public interface TaskOperationsAdministr
 	public GetTaskInfoResponseDocument getTaskInfo(Long id) throws IllegalArgumentFault;
 	public SuspendUntilResponseDocument suspendUntil(Long id, TTime time) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault;
 	public RemoveResponseDocument remove(Long id) throws IllegalArgumentFault, IllegalAccessFault;
  
+	public ResumeResponseDocument resume(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault;
+	public SuspendResponseDocument suspend(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault;
+	public ActivateResponseDocument activate(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault;
+	public ClaimResponseDocument claim(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault ;
+	public SetPriorityResponseDocument setPriority(Long id, BigInteger priority) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault;
 }

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsBaseImpl.java
Mon Aug 23 07:07:34 2010
@@ -389,7 +389,10 @@ public abstract class TaskOperationsBase
 //    public void suspend(String identifier) throws IllegalAccessFault, IllegalStateFault,
IllegalArgumentFault {
         String identifier = suspend.getSuspend().getIdentifier();
 
-        Task t = Task.load(hiseEngine, Long.parseLong(identifier));
+        return suspend(new Long(identifier));
+    }
+    public SuspendResponseDocument suspend(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault {
+        Task t = Task.load(hiseEngine, id);
         TaskChecker.checkHumanRolePermission(HumanOperationName.SUSPEND, getUserString(),
t);
         TaskChecker.checkStatePermission(HumanOperationName.SUSPEND, t);
         t.setCurrentUser(getUserString());
@@ -464,9 +467,11 @@ public abstract class TaskOperationsBase
     public ResumeResponseDocument resume(ResumeDocument resume) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault {
 //    public void resume(String identifier) throws IllegalAccessFault, IllegalStateFault,
IllegalArgumentFault {
         String identifier = resume.getResume().getIdentifier();
-
-        // OrgEntity user = loadUser();
-        Task t = Task.load(hiseEngine, Long.parseLong(identifier));
+        return resume(Long.parseLong((identifier)));
+    }
+    public ResumeResponseDocument resume(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault {
+    	// OrgEntity user = loadUser();
+        Task t = Task.load(hiseEngine, id);
         TaskChecker.checkHumanRolePermission(HumanOperationName.RESUME, getUserString(),
t);
         TaskChecker.checkStatePermission(HumanOperationName.RESUME, t);
         t.setCurrentUser(getUserString());
@@ -483,7 +488,7 @@ public abstract class TaskOperationsBase
 
         return responseDocument;
     }
-
+    
     public GetTaskInfoResponseDocument getTaskInfo(GetTaskInfoDocument getTaskInfo) throws
IllegalArgumentFault {
 //    public org.apache.hise.lang.xsd.htda.TTask getTaskInfo(String identifier) throws IllegalArgumentFault
{
         String identifier = getTaskInfo.getGetTaskInfo().getIdentifier();
@@ -502,8 +507,10 @@ public abstract class TaskOperationsBase
     public ClaimResponseDocument claim(ClaimDocument claim) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault {
 //    public void claim(String identifier) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault {
         String identifier = claim.getClaim().getIdentifier();
-
-        Task task = Task.load(hiseEngine, Long.valueOf(identifier));
+        return claim(new Long(identifier));
+    }
+    public ClaimResponseDocument claim(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault {
+        Task task = Task.load(hiseEngine, id);
         TaskChecker.checkHumanRolePermission(HumanOperationName.CLAIM, getUserString(), task);
         TaskChecker.checkStatePermission(HumanOperationName.CLAIM, task);
         task.setCurrentUser(getUserString());
@@ -739,7 +746,10 @@ public abstract class TaskOperationsBase
     public ActivateResponseDocument activate(ActivateDocument activate) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault {
 //    public void activate(String identifier) throws IllegalAccessFault, IllegalStateFault,
IllegalArgumentFault {
         String identifier = activate.getActivate().getIdentifier();
-    	Task task = Task.load(hiseEngine, new Long(identifier));
+        return activate(new Long(identifier));
+    }
+    public ActivateResponseDocument activate(Long id) throws IllegalArgumentFault, IllegalStateFault,
IllegalAccessFault {
+    	Task task = Task.load(hiseEngine, id);
         TaskChecker.checkHumanRolePermission(HumanOperationName.ACTIVATE, getUserString(),
task);
         TaskChecker.checkStatePermission(HumanOperationName.ACTIVATE, task);
         
@@ -1168,7 +1178,10 @@ public abstract class TaskOperationsBase
         String identifier = setPriority.getSetPriority().getIdentifier();
         BigInteger priority = setPriority.getSetPriority().getPriority();
 
-        Task task = Task.load(hiseEngine, new Long(identifier));
+       return setPriority(Long.parseLong(identifier), priority);
+    }
+    public SetPriorityResponseDocument setPriority(Long id, BigInteger priority) throws IllegalArgumentFault,
IllegalStateFault, IllegalAccessFault {
+        Task task = Task.load(hiseEngine, id);
         TaskChecker.checkHumanRolePermission(HumanOperationName.SET_PRIORITY, getUserString(),
task);
         org.apache.hise.dao.Task taskDto = task.getTaskDto();
         taskDto.setPriority(priority.intValue());

Modified: incubator/hise/trunk/rtests/src/test/java/org/apache/hise/TaskTestBase.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/rtests/src/test/java/org/apache/hise/TaskTestBase.java?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/rtests/src/test/java/org/apache/hise/TaskTestBase.java (original)
+++ incubator/hise/trunk/rtests/src/test/java/org/apache/hise/TaskTestBase.java Mon Aug 23
07:07:34 2010
@@ -7,13 +7,19 @@ import org.junit.runner.RunWith;
 import org.springframework.orm.jpa.JpaTransactionManager;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.apache.hise.dao.HISEDao;
+import org.apache.hise.dao.OrgEntity;
+import org.apache.hise.dao.TaskOrgEntity.OrgEntityType;
 import org.apache.hise.engine.HISEEngineImpl;
 import org.apache.hise.lang.TaskDefinition;
 import org.apache.hise.lang.xsd.htd.TTaskInterface;
 import org.apache.hise.utils.DOMUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
+import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.support.TransactionCallback;
+import org.springframework.transaction.support.TransactionTemplate;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.apache.hise.runtime.Task;
@@ -69,4 +75,30 @@ public abstract class TaskTestBase {
 
         return t;
     }
+    
+    protected void addUser(String name){
+    	TransactionTemplate tt = new TransactionTemplate(transactionManager);
+    	addUserInTranscaction(tt,name, hiseEngine.getHiseDao());
+    }
+    
+    public void addUserInTranscaction(TransactionTemplate tt,final String name, final HISEDao
hiseDao){
+   	 tt.execute(new TransactionCallback() {
+           public Object doInTransaction(TransactionStatus arg0) {
+               try {
+   
+            	   OrgEntity user = new OrgEntity();
+
+                       user.setName(name);
+                       user.setType(OrgEntityType.USER);
+                       user.setUserPassword("pass");
+
+               		hiseDao.persist(user);
+               	
+               } catch (Exception e) {
+                   throw new RuntimeException(e);
+               }
+				return arg0;
+           }
+       });
+   }
 }

Modified: incubator/hise/trunk/rtests/src/test/java/org/apache/hise/managementApi/ManagementApiTest.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/rtests/src/test/java/org/apache/hise/managementApi/ManagementApiTest.java?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/rtests/src/test/java/org/apache/hise/managementApi/ManagementApiTest.java
(original)
+++ incubator/hise/trunk/rtests/src/test/java/org/apache/hise/managementApi/ManagementApiTest.java
Mon Aug 23 07:07:34 2010
@@ -1,7 +1,9 @@
 package org.apache.hise.managementApi;
 
+import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Random;
 
 import javax.xml.namespace.QName;
 
@@ -21,6 +23,7 @@ import org.apache.hise.lang.xsd.htdt.Get
 import org.apache.hise.runtime.Task;
 import org.junit.Before;
 import org.junit.Test;
+import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.support.TransactionCallback;
 import org.springframework.transaction.support.TransactionTemplate;
@@ -36,13 +39,15 @@ public class ManagementApiTest extends T
     public void setUp() throws Exception {
         init("test-example/test.xml");
         task = getTask("test-example/approveHeader.xml", "test-example/approveBody.xml",
new QName("http://www.insurance.example.com/claims", "Task1"));
-        TransactionTemplate tt = new TransactionTemplate(transactionManager);
-        addUserInTranscaction(tt,task.getTaskDto().getActualOwner(), hiseEngine.getHiseDao());
-        //addUserInTranscaction(tt,new String("user"), hiseEngine.getHiseDao());
+ 
+//        addUserInTranscaction(tt,new String("user1"), hiseEngine.getHiseDao());
     }
 
     @Test
+    @DirtiesContext
     public void testStartStopRelease() throws IllegalArgumentFault, IllegalStateFault, IllegalAccessFault{
+        TransactionTemplate tt = new TransactionTemplate(transactionManager);
+        addUserInTranscaction(tt,task.getTaskDto().getActualOwner(), hiseEngine.getHiseDao());
     Long id= task.getTaskDto().getId();
 			
     	management.start(id.toString(), task.getTaskDto().getActualOwner());
@@ -63,6 +68,7 @@ public class ManagementApiTest extends T
     @Test
     public void testGetTaskInfo() throws IllegalArgumentFault{
     	Long id= task.getTaskDto().getId();
+    	System.out.println("---id: "+id);
     	GetTaskInfoResponseDocument response=management.getTaskInfo(id);
     	Assert.assertEquals(task.getTaskDto().getActualOwner(),response.getGetTaskInfoResponse().getTask().getActualOwner());
     	
@@ -70,7 +76,12 @@ public class ManagementApiTest extends T
     
     @Test
     public void testDelegate() throws RecipientNotAllowed, IllegalStateFault, IllegalArgumentFault,
IllegalAccessFault{
+        TransactionTemplate tt = new TransactionTemplate(transactionManager);
+        addUserInTranscaction(tt,task.getTaskDto().getActualOwner(), hiseEngine.getHiseDao());
+    	
     	Long id= task.getTaskDto().getId();
+    	
+    	
     	management.start(id.toString(), task.getTaskDto().getActualOwner());
     	Assert.assertEquals(task.getTaskDto().getStatus(), Status.IN_PROGRESS);
     	addUser(new String("newUser"));
@@ -81,31 +92,19 @@ public class ManagementApiTest extends T
     	Assert.assertEquals(new String("newUser"), task.getTaskDto().getActualOwner());
     
     }
+    @Test
+    public void testPriority() throws RecipientNotAllowed, IllegalStateFault, IllegalArgumentFault,
IllegalAccessFault{
+        TransactionTemplate tt = new TransactionTemplate(transactionManager);
+        addUserInTranscaction(tt,task.getTaskDto().getActualOwner(), hiseEngine.getHiseDao());
+    	
+    	Long id= task.getTaskDto().getId();
+    	BigInteger prio =new BigInteger(4, new Random(222));
+    	management.setPriority(id, prio, "user1");
+    	Assert.assertEquals(prio.intValue(), task.getTaskDto().getPriority());
+    
     
-    private void addUser(String name){
-    	TransactionTemplate tt = new TransactionTemplate(transactionManager);
-    	addUserInTranscaction(tt,name, hiseEngine.getHiseDao());
     }
     
-    public void addUserInTranscaction(TransactionTemplate tt,final String name, final HISEDao
hiseDao){
-   	 tt.execute(new TransactionCallback() {
-           public Object doInTransaction(TransactionStatus arg0) {
-               try {
-   
-            	   OrgEntity user = new OrgEntity();
-
-                       user.setName(name);
-                       user.setType(OrgEntityType.USER);
-                       user.setUserPassword("pass");
-
-               		hiseDao.persist(user);
-               	
-               } catch (Exception e) {
-                   throw new RuntimeException(e);
-               }
-				return arg0;
-           }
-       });
-   }
+  
 	
 }

Modified: incubator/hise/trunk/rtests/src/test/resources/test-example/test.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/rtests/src/test/resources/test-example/test.xml?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/rtests/src/test/resources/test-example/test.xml (original)
+++ incubator/hise/trunk/rtests/src/test/resources/test-example/test.xml Mon Aug 23 07:07:34
2010
@@ -28,6 +28,17 @@
               <property name="handler" ref="handler"/>
               <property name="sender" ref="sender"/>
             </bean>
+            
+            <bean class="org.apache.hise.engine.store.TaskDD">
+              <property name="taskName">
+                <bean class="javax.xml.namespace.QName" factory-method="valueOf">
+                  <constructor-arg type="java.lang.String" value="{http://www.insurance.example.com/claims}Task4"></constructor-arg>
+                </bean>
+              </property>
+              <property name="handler" ref="handler"/>
+              <property name="sender" ref="sender"/>
+            </bean>
+            
           </list>
         </property>
       </bean>

Modified: incubator/hise/trunk/rtests/src/test/resources/test-example/testHtd1.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/rtests/src/test/resources/test-example/testHtd1.xml?rev=988005&r1=988004&r2=988005&view=diff
==============================================================================
--- incubator/hise/trunk/rtests/src/test/resources/test-example/testHtd1.xml (original)
+++ incubator/hise/trunk/rtests/src/test/resources/test-example/testHtd1.xml Mon Aug 23 07:07:34
2010
@@ -364,7 +364,91 @@ Business Machines Corporation, Oracle In
       </htd:escalation>
     </htd:completionDeadline>
   </htd:deadlines>
-        </htd:task>    
+        </htd:task>
+        
+	<htd:task name="Task4">
+		<htd:documentation
+			xml:lang="en-US"
+		>This task is used to handle claims that require manual approval.
+		</htd:documentation>
+		<htd:interface
+			portType="tns:ClaimsHandlingPT"
+			operation="approve4"
+			responsePortType="tns:ClaimsHandlingCallbackPT"
+			responseOperation="approvalResponse" />
+		<htd:priority>
+			xs:integer(htd:getInput("ClaimApprovalRequest")/cla:prio)
+		</htd:priority>
+		<htd:peopleAssignments>
+			<htd:potentialOwners>
+				<htd:from>
+					<htd:literal>
+						<htd:organizationalEntity>
+							<htd:users>
+								<htd:user>user1</htd:user>
+							</htd:users>
+						</htd:organizationalEntity>
+					</htd:literal>
+				</htd:from>
+			</htd:potentialOwners>
+			<htd:businessAdministrators>
+				<htd:from>
+					<htd:literal>
+						<htd:organizationalEntity>
+							<htd:users>
+								<htd:user>user1</htd:user>
+								<htd:user>user2</htd:user>
+							</htd:users>
+						</htd:organizationalEntity>
+					</htd:literal>
+				</htd:from>
+			</htd:businessAdministrators>
+			<htd:taskStakeholders>
+				<htd:from>
+					<htd:literal>
+						<htd:organizationalEntity>
+							<htd:users>
+								<htd:user>user3</htd:user>
+							</htd:users>
+						</htd:organizationalEntity>
+					</htd:literal>
+				</htd:from>
+			</htd:taskStakeholders>
+		</htd:peopleAssignments>
+		<htd:presentationElements>
+			<htd:name
+				xml:lang="en-US"
+			> Approve Claim</htd:name>
+			<htd:presentationParameters>
+				<htd:presentationParameter
+					name="firstname"
+					type="xsd:string"
+				> htd:getInput("ClaimApprovalRequest")/cust/firstname
+				</htd:presentationParameter>
+				<htd:presentationParameter
+					name="lastname"
+					type="xsd:string"
+				> htd:getInput("ClaimApprovalRequest")/cust/lastname
+				</htd:presentationParameter>
+				<htd:presentationParameter
+					name="euroAmount"
+					type="xsd:double"
+				> htd:getInput("ClaimApprovalRequest")/amount
+				</htd:presentationParameter>
+			</htd:presentationParameters>
+			<htd:subject
+				xml:lang="en-US"
+			> Approve the insurance claim for PLN $euroAmount$ on behalf of
+				$firstname$ $lastname$</htd:subject>
+			<htd:description
+				xml:lang="en-US"
+				contentType="text/plain"
+			> Approve this claim following corporate guideline #4711.0815/7 ...
+			</htd:description>
+		</htd:presentationElements>
+		<htd:outcome>someOutput</htd:outcome>
+	</htd:task>  
+    
     </htd:tasks>
     
     <htd:notifications>



Mime
View raw message