Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Task.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 490)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Task.java	(revision 883)
@@ -6,6 +6,10 @@
 import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
 import org.qcg.broker.schemas.resreqs.ExecutionTimeType;
+import org.qcg.broker.schemas.resreqs.ExecutionType;
+import org.qcg.broker.schemas.resreqs.PhaseBehaviourType;
 import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements;
 import org.qcg.broker.schemas.resreqs.Requirements;
+import org.qcg.broker.schemas.resreqs.ResourceConsumptionProfileType;
+import org.qcg.broker.schemas.resreqs.ResourceConsumptionType;
 import org.qcg.broker.schemas.resreqs.TaskResourceRequirements;
 import org.qcg.broker.schemas.resreqs.TimePeriod;
@@ -30,4 +34,6 @@
 import schedframe.scheduling.WorkloadUnitHandler;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.phases.ResourceConsumption;
+import schedframe.scheduling.tasks.phases.ResourceConsumptionProfile;
 import schedframe.scheduling.tasks.requirements.ResourceParameterName;
 
@@ -71,4 +77,6 @@
 	private int senderId;
 	private long workloadLogWaitTime;
+	
+	private ResourceConsumptionProfile resourceConsumptionProfile;
 
 	public Task(org.qcg.broker.schemas.resreqs.Task task){
@@ -91,4 +99,28 @@
 	}
 
+	private void preparePhases() {
+		List<ResourceConsumption> resourceConsumptionList = new ArrayList<ResourceConsumption>();
+		
+		if(task.getExecution() == null || task.getExecution().getResourceConsumptionProfile() == null){
+			ResourceConsumption resConsumption = null;
+			try {
+				resConsumption = new ResourceConsumption(this.length, getComputingResourceRequirements());
+			} catch (NoSuchFieldException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			resourceConsumptionList.add(resConsumption);
+		}
+		else{
+			for(ResourceConsumptionType resConsumption: task.getExecution().getResourceConsumptionProfile().getResourceConsumption()){
+				ResourceConsumption resourceConsumption = new ResourceConsumption(resConsumption);
+				resourceConsumptionList.add(resourceConsumption);
+			}
+		}
+		this.resourceConsumptionProfile = new ResourceConsumptionProfile(resourceConsumptionList);
+		
+	//	System.out.println("======"+task.getExecution().getExecutable().getApplication().getName());
+	}
+	
 	public DateTime getExecutionStartTime() throws NoSuchFieldException {
 		if(this.startTime != null)
@@ -421,4 +453,5 @@
 	public void setLength(long length) {
 		this.length = length;
+		preparePhases();
 	}
 
@@ -485,3 +518,11 @@
 		wuh.handleTask(this);
 	}
+	
+	public ResourceConsumptionProfile getResourceConsumptionProfile(){
+		return resourceConsumptionProfile;
+	}
+	
+	public String getApplicationName(){
+		return task.getExecution().getExecutable().getApplication().getName();
+	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseBehaviour.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseBehaviour.java	(revision 883)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseBehaviour.java	(revision 883)
@@ -0,0 +1,32 @@
+package schedframe.scheduling.tasks.phases;
+
+import org.qcg.broker.schemas.resreqs.PhaseBehaviourType;
+
+public class PhaseBehaviour {
+	
+	protected String resName;
+	protected double utilization;
+	
+	PhaseBehaviour(String resName, double utilization) {
+		this.resName = resName;
+		this.utilization = utilization;
+	}
+	
+	PhaseBehaviour(String resName) {
+		this.resName = resName;
+		this.utilization = 100;
+	}
+	
+	PhaseBehaviour(PhaseBehaviourType pbt) {
+		this.resName = pbt.getName();
+		this.utilization = pbt.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent();
+	}
+	
+	public String getResouceName() {
+		return resName;
+	}
+	
+	public double getUtilization() {
+		return utilization;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumption.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumption.java	(revision 883)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumption.java	(revision 883)
@@ -0,0 +1,72 @@
+package schedframe.scheduling.tasks.phases;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
+import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
+import org.qcg.broker.schemas.resreqs.PhaseBehaviourType;
+import org.qcg.broker.schemas.resreqs.ResourceConsumptionType;
+
+public class ResourceConsumption {
+
+	protected String id;
+    protected String referenceHardware;
+    protected long duration;
+    protected List<PhaseBehaviour> phaseBehaviourList;
+    
+    public ResourceConsumption(long duration, ComputingResourceBaseTypeItem item[]){
+    	this.id = null;
+    	this.referenceHardware = null;
+    	this.duration = duration;
+    	this.phaseBehaviourList = new ArrayList<PhaseBehaviour>();
+    	for(ComputingResourceBaseTypeItem compResItem: item){
+    		ComputingResourceParameterType hostParameter = compResItem.getHostParameter();
+        	PhaseBehaviour pb = new PhaseBehaviour(hostParameter.getName().toString());
+        	phaseBehaviourList.add(pb);
+    	}
+    }
+    
+    public ResourceConsumption(ResourceConsumptionType resConsumptionType){
+    	this.id = resConsumptionType.getId();
+    	this.referenceHardware = resConsumptionType.getReferenceHardware();
+    	this.duration = resConsumptionType.getDuration().toLong()/1000;
+    	this.phaseBehaviourList = new ArrayList<PhaseBehaviour>();
+    	for(PhaseBehaviourType pbt: resConsumptionType.getBehaviour()){
+        	PhaseBehaviour pb = new PhaseBehaviour(pbt);
+        	phaseBehaviourList.add(pb);
+    	}
+    }
+    
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getReferenceHardware() {
+		return referenceHardware;
+	}
+
+	public void setReferenceHardware(String referenceHardware) {
+		this.referenceHardware = referenceHardware;
+	}
+
+	public long getDuration() {
+		return duration;
+	}
+
+	public void setDuration(long duration) {
+		this.duration = duration;
+	}
+
+	public List<PhaseBehaviour> getBehaviourList() {
+		return phaseBehaviourList;
+	}
+
+	public void setBehaviourList(List<PhaseBehaviour> behaviourList) {
+		this.phaseBehaviourList = behaviourList;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumptionProfile.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumptionProfile.java	(revision 883)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumptionProfile.java	(revision 883)
@@ -0,0 +1,17 @@
+package schedframe.scheduling.tasks.phases;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ResourceConsumptionProfile {
+	
+	protected List<ResourceConsumption> resourceConsumptionList;
+	
+	public ResourceConsumptionProfile() {
+		this.resourceConsumptionList = new ArrayList<ResourceConsumption>();
+	}
+	
+	public ResourceConsumptionProfile(List<ResourceConsumption> resourceConsumptionList) {
+		this.resourceConsumptionList = resourceConsumptionList;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Processes.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java	(revision 481)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Processes.java	(revision 883)
@@ -41,5 +41,5 @@
 		CountType countType = choice.getProcessesCount();
 		if(countType != null) {
-			return countType.getValue().getContent().intValue();
+			return countType.getValue().getContent();
 		} 
 		
