incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r.@apache.org
Subject svn commit: r964061 - in /incubator/hise/trunk/hise-services/src/main/java/org/apache/hise: dao/JpaBase.java dao/Task.java engine/jaxws/TaskOperationsImpl.java runtime/Task.java
Date Wed, 14 Jul 2010 14:38:42 GMT
Author: rr
Date: Wed Jul 14 14:38:42 2010
New Revision: 964061

URL: http://svn.apache.org/viewvc?rev=964061&view=rev
Log:
HISE-48: Incomplete peopleAssigment during creating taks (Thanks to PaweĊ‚ Byszewski)

Modified:
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java?rev=964061&r1=964060&r2=964061&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/JpaBase.java Wed
Jul 14 14:38:42 2010
@@ -51,6 +51,9 @@ public abstract class JpaBase {
         Collections.addAll(l1, getKeys());
         List<Object> l2 = new ArrayList<Object>();
         Collections.addAll(l2, ((JpaBase) obj).getKeys());
+        if(l1.equals(l2) && (l1.size() == 1) && l1.contains(null)) {
+        	 return super.equals(obj);
+        }
         return l1.equals(l2);
     }
 

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java?rev=964061&r1=964060&r2=964061&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/dao/Task.java Wed Jul
14 14:38:42 2010
@@ -238,11 +238,11 @@ public class Task extends JpaBase {
 //
    //@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
    //@JoinTable(name = "TASK_STAKEHOLDERS", joinColumns = @JoinColumn(name = "TASK"), inverseJoinColumns
= @JoinColumn(name = "ASSIGNEE"))
-   private Set<TaskOrgEntity> taskStakeholders;
+  // private Set<TaskOrgEntity> taskStakeholders;
 //
   //  @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
    // @JoinTable(name = "TASK_BUSINESS_AMINISTRATORS", joinColumns = @JoinColumn(name = "TASK"),
inverseJoinColumns = @JoinColumn(name = "ASSIGNEE"))
-    private Set<TaskOrgEntity> businessAdministrators;
+    //private Set<TaskOrgEntity> businessAdministrators;
 //
 //    @ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
 //    @JoinTable(name = "TASK_NOTIFICATION_RECIPIENTS", joinColumns = @JoinColumn(name =
"TASK"), inverseJoinColumns = @JoinColumn(name = "ASSIGNEE"))
@@ -420,25 +420,33 @@ public class Task extends JpaBase {
 //    }
 //
     public Set<TaskOrgEntity> getTaskStakeholders() {
-        return taskStakeholders;
+        Set<TaskOrgEntity> result = new HashSet<TaskOrgEntity>();
+        for(TaskOrgEntity e: peopleAssignments)
+        {
+           if (e.getGenericHumanRole() == GenericHumanRole.TASKSTAKEHOLDERS) {
+               result.add(e);
+           }
+        }
+        return result;
     }
 
-    public void setTaskStakeholders(Set<TaskOrgEntity> taskStakeholders) {
-        this.taskStakeholders = taskStakeholders;
-    }
 
-    public Set<TaskOrgEntity> getBusinessAdministrators() {
-        return businessAdministrators;
+
+    public Set<TaskOrgEntity> getBusinessAdministrators(){
+        Set<TaskOrgEntity> result = new HashSet<TaskOrgEntity>();
+        for(TaskOrgEntity e: peopleAssignments)
+        {
+           if (e.getGenericHumanRole() == GenericHumanRole.BUSINESSADMINISTRATORS) {
+               result.add(e);
+           }
+        }
+        return result;
     }
 
     public void setBusinessAdministrators(Set<TaskOrgEntity> businessAdministrators)
{
-        this.businessAdministrators = businessAdministrators;
-    }
-    public void addBusinessAdministrator(TaskOrgEntity taskOrg) {
-        
-		this.taskStakeholders.add(taskOrg);
-		
+        this.peopleAssignments.addAll(businessAdministrators);
     }
+
 //
 //    public Set<TaskOrgEntity> getNotificationRecipients() {
 //        return notificationRecipients;

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java?rev=964061&r1=964060&r2=964061&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/jaxws/TaskOperationsImpl.java
Wed Jul 14 14:38:42 2010
@@ -550,12 +550,7 @@ public class TaskOperationsImpl implemen
         
         }
 
-                TOrganizationalEntity TorgEntity =new TOrganizationalEntity();
-                if(null!=taskDto.getBusinessAdministrators())
-                for(TaskOrgEntity e: taskDto.getBusinessAdministrators()){
-                		TorgEntity.getUsers().getUser().add(e.getName());
-                }
-        //result.setBusinessAdministrators(TorgEntity);
+   
              
         result.setPriority(new BigInteger(new Integer(taskDto.getPriority()).toString()));
         result.setIsSkipable(taskDto.isSkippable());

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java?rev=964061&r1=964060&r2=964061&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java Wed
Jul 14 14:38:42 2010
@@ -183,26 +183,6 @@ public class Task {
             }
         }
     }
-    private void tryNominateBusinessAdministrator(){// throws HiseIllegalStateException{
-    	        int poSize = 0;
-    	       TaskOrgEntity selected = null;
-    	       for (TaskOrgEntity e : taskDto.getPeopleAssignments()) {
-    	            if (e.getGenericHumanRole() == GenericHumanRole.BUSINESSADMINISTRATORS)
{
-    	                poSize ++;
-                    if (e.getType() == TaskOrgEntity.OrgEntityType.USER) {
-    	                    selected = e;
-                    }
-    	            }
-    	       }
-            //DEBUG
-
-    	 
-    	   if (poSize == 1 && selected != null) {
-    	            //Nominate a single Business Administrator
-    	            addBusinessAdministrator(selected);
-    	   }
-    	        
-    }
 
     public static Task create(HISEEngineImpl engine, TaskDefinition taskDefinition, String
createdBy, Node requestXml, Node requestHeader) {
 
@@ -254,7 +234,7 @@ public class Task {
         }
         
              
-        t.tryNominateBusinessAdministrator();
+        
         taskDto.setSkippable(true);
         return t;
 
@@ -784,9 +764,7 @@ public class Task {
         tryNominateOwner();
     }
     
-     public void addBusinessAdministrator(TaskOrgEntity taskOrg) {
-    	    taskDto.addBusinessAdministrator(taskOrg);
-     }
+
 
 
     //    



Mime
View raw message