Tuesday, June 12, 2012

Custom Task Assiginment



public void taskAssignList(){
            String[] assignToEmpty = new String[] {};
            String[] assignTo = new String[] {getDelegatePrincipalID()};
            String[] getAssignToList = new String[20];
       //get the selected task ids
            List selectedTaskIDs = getSelectedTaskIDs();
            Iterator it = selectedTaskIDs.iterator();
            while (it.hasNext()) {
                  //create the task instance
                  View_paymentdetails v_paymentdetails=new View_paymentdetails();
                  //set the task id to task instance
                  v_paymentdetails.setTaskID(it.next().toString());
                  try {
                        //make the task assignment list empty
                        v_paymentdetails.getTaskInfo().setAssignedToList(assignToEmpty);
                        //set task assignment list
                        v_paymentdetails.getTaskInfo().setAssignedToList(assignTo);
                        getAssignToList=v_paymentdetails.getTaskInfo().getAssignedToList();
                  //    apply the changes on the task instance
                        v_paymentdetails.applyChanges();
                 
                  } catch (Exception e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                  }
            getTaskSearchProvider().refresh();
      }

      }



Get Bussiness data:


public  void getAllBusinessData(){
             Task_Payment_details[] task_Payment_details=null;
          com.webmethods.caf.faces.data.task.ITask[] allTaskData=null;
            //ITaskData tasksData=null;
            try {
                  allTaskData = getTaskSearchProvider().getResults();
                                          
            } catch (Exception e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
            }
//creating the
            ArrayList loanRefValuesData11=new ArrayList();
            ArrayList balanceData=new ArrayList();
            if(allTaskData.length!=0){
        for(int i=0;ilength;i++){
            task_Payment_details = new Task_Payment_details[allTaskData.length];
//we are creating the task instance
                  View_paymentdetails v_paymentdetails=new View_paymentdetails();
                  try {
                              v_paymentdetails.setTaskID(allTaskData[i].getTaskInfo().getTaskID());
                        } catch (Exception e) {
                              // TODO Auto-generated catch block
                              e.printStackTrace();
                        }
//Add the business data into the list
loanRefValuesData11.add(v_paymentdetails.getTaskData().getPayment_details().getLoan_Reference());
                    balanceData.add(v_paymentdetails.getTaskData().getPayment_details().getBalance());
//Remove the duplicates from the list
                  loanRefValuesData= removeDuplicates(loanRefValuesData11);
                    balancebusinessData=removeDuplicates(balanceData);
         
            }
        }
      }


1 comment: