/*
#=======================================================================================================
#
#                   Copyright (c) 2007 Origin Enterprise Solution LTD.
#
#=======================================================================================================
# File description:  QueryTaskOpinion.java
#=======================================================================================================
#	 Date	       time   	   Name	 Action	   Description of Change
#	2011-1-17      上午10:29:16    tyl  	Ini	            初始化文件
#	2011-4-25      上午10:38:00	   zyn  	修改		     横向显示模式修改为纵向显示模式
# 	2011-5-24      上午12:02:00	   zyn		add		  添加流程名称列		
#=======================================================================================================
 */
package cust.com.rac.workflow;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JScrollPane;

import cn.com.customization.util.QueryTaskOpinionTableHead;

import com.fnd0.services.internal.rac.auditmanager.ProcessHistoryManagementService;
import com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct;
import com.teamcenter.rac.aif.AbstractAIFUIApplication;
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
import com.teamcenter.rac.kernel.TCComponent;
import com.teamcenter.rac.kernel.TCComponentDataset;
import com.teamcenter.rac.kernel.TCComponentFnd0AuditLog;
import com.teamcenter.rac.kernel.TCComponentFolder;
import com.teamcenter.rac.kernel.TCComponentForm;
import com.teamcenter.rac.kernel.TCComponentItemRevision;
import com.teamcenter.rac.kernel.TCComponentProcess;
import com.teamcenter.rac.kernel.TCComponentTask;
import com.teamcenter.rac.kernel.TCComponentUser;
import com.teamcenter.rac.kernel.TCException;
import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.kernel.UserList;
import com.teamcenter.rac.processhistory.BaseProcessHistoryEntry;
import com.teamcenter.rac.util.MessageBox;

public class QueryTaskOpinionOperation {
	private Vector<String>	taskNameVector;
	private Vector<SignInfo> vector_infor;
	private String			firstTaskName			= "";
	private List<String>	RouteTaskList		    = new ArrayList<String>();
	private List<String>	AcknowladgeTaskList		= new ArrayList<String>();
	private List<String>	reviewTaskList			= new ArrayList<String>();
	private List<String>	doTaskList				= new ArrayList<String>();
	private List<String>	conditionTaskList		= new ArrayList<String>();
	private List<String>	addStatusTaskList		= new ArrayList<String>();
	private List<String>	smallTitleList			= new ArrayList<String>();
	private Vector<String>	tableTitleVector;
	private String[]		doAndConditionTaskTitle	= { "执行者", "完成时间", "注释" };
	private String[]		firstTaskTitle			= { "执行者", "提交时间", "注释" };
	private String[]		auditingTitle			= { "会签", "审核时间", "注释" };
	private String[]		notifyTitle				= { "会签", "认可时间", "注释" };

	private List rootProcessHistory;
    private List processNames;
    
	public QueryTaskOpinionOperation(AbstractAIFUIApplication abstractaifuiapplication, String s) {
		this.myuiapp = abstractaifuiapplication;
		session = (TCSession) this.myuiapp.getSession();
		run();
	}

	//-----------------------------------------------------*-*-
	public void readInfo(InterfaceAIFComponent ainterfaceaifcomponent) {
		//InterfaceAIFComponent ainterfaceaifcomponent = myuiapp.getTargetComponent();
		if (ainterfaceaifcomponent != null) {
			
			ProcessHistoryManagementService processhistorymanagementservice = ProcessHistoryManagementService.getService(session);
	        com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.GetProcessHistoryAuditRecordsResponse getprocesshistoryauditrecordsresponse = processhistorymanagementservice.getProcssHistoryAuditRecords((TCComponent) ainterfaceaifcomponent);
	        com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct[] = getprocesshistoryauditrecordsresponse.rootProcessHistoryAuditRecords;
	        //-----------------------------------------------------
	        rootProcessHistory = new ArrayList();
	        processNames = new ArrayList();
	        String as1[];
	        int j = (as1 = getprocesshistoryauditrecordsresponse.processNames).length;
	        for(int i = 0; i < j; i++)
	        {
	            String s = as1[i];
	            //System.out.println("s================"+s);
	            processNames.add(s);
	        }
	        loadProcessHistoryData(aprocesshistoryauditrecordstruct);
//	        loadProcessHistoryData(aprocesshistoryauditrecordstruct, rootProcessHistory);
//	        
//	        System.out.println("rootProcessHistory.size()="+rootProcessHistory.size());
//	        TCComponent comp = ((BaseProcessHistoryEntry)rootProcessHistory.get(0)).getComponent();
//	        String[] strNames = comp.getPropertyNames();
//	        for(int i = 0; i < strNames.length; i++){
//	        	System.out.println("strNames["+i+"]="+strNames[i]);
//	        	try {
//					System.out.println(comp.getProperty(strNames[i]));
//				} catch (TCException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				}
//	        }
		}
	}
	
	private void loadProcessHistoryData(ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct[])
    {
        com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct1[];
        int j = (aprocesshistoryauditrecordstruct1 = aprocesshistoryauditrecordstruct).length;
        //System.out.println("j="+j);
        String templateName = "";
        String taskType = "";
        String taskName = "";
        String endTime = "";
        String result = "";
        String pzUser = "";
        String comment = "";
        String eventType = "";
        boolean isNotFirstGobak = false;
        
        for(int i = 0; i < j; i++)
        {
            com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct processhistoryauditrecordstruct = aprocesshistoryauditrecordstruct1[i];
            BaseProcessHistoryEntry baseprocesshistoryentry = new BaseProcessHistoryEntry();
            if(processhistoryauditrecordstruct.auditRecord != null)
            {
            	try {
					if(processhistoryauditrecordstruct.auditRecord.getProperty("fnd0EventTypeName").equals("删除")){
						continue;
					}
				} catch (TCException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
            	com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct2[] = processhistoryauditrecordstruct.childrenAuditRecords;
            	for(int k = 0; k < aprocesshistoryauditrecordstruct2.length; k++ ){
            		int num = 1;
            		
            		try {
						templateName = aprocesshistoryauditrecordstruct2[k].auditRecord.getProperty("object_name");
						System.out.println("templateName = "+templateName);
					} catch (TCException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
            		com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct3[] = aprocesshistoryauditrecordstruct2[k].childrenAuditRecords;
            		for(int m = 0; m < aprocesshistoryauditrecordstruct3.length; m++){
            			if(num != 1){
            				templateName = "";
            			}else{
            				num++;
            			}
            			try {
            				taskType = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("object_type");
            				if(taskType.equals("EPMOrTask")){
            					continue;
            				}
            				eventType = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("fnd0EventTypeName");
            				if(eventType.equals("退回")){
            					if(isNotFirstGobak){
            						continue;
            					}else{
            						isNotFirstGobak = true;
            						if(taskType.equals("EPMDoTask")){
            							taskName = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("object_name");
    	            					endTime = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("fnd0LoggedDate");
    	            					//result = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("task_result");
    	            					comment = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("fnd0Comments");
    	            					SignInfo oneSignInfo = new SignInfo();
    	            					oneSignInfo.processName = templateName;
    	            					oneSignInfo.num = num++;
    	            					oneSignInfo.taskName = taskName;
    	    							oneSignInfo.actionTime = endTime;
    	    							oneSignInfo.userAction = "Rejected";
    	    							oneSignInfo.userComments = comment;
    	            					pzUser = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("fnd0UserId");
    	    							TCComponentUser tccomponentuser = UserList.getUser(session, "(" + pzUser + ")");
    	    							if (tccomponentuser != null) {
    	    								pzUser = tccomponentuser.toString();
    	    								oneSignInfo.userName = pzUser;
    	    							}
    	    							vector_infor.add(oneSignInfo);
        							}else{
        								taskName = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("object_name");
        								getComment( aprocesshistoryauditrecordstruct3[m], templateName, taskName );
        							}
            					}
            				}else{//else if(!eventType.equals("开始"))
            					isNotFirstGobak = false;
            					if(taskType.equals("EPMDoTask")||taskType.equals("EPMConditionTask")){
        							taskName = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("object_name");
	            					endTime = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("fnd0LoggedDate");
	            					result = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("task_result");
	            					comment = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("fnd0Comments");
	            					SignInfo oneSignInfo = new SignInfo();
	            					oneSignInfo.processName = templateName;
	            					oneSignInfo.num = num++;
	            					oneSignInfo.taskName = taskName;
	    							oneSignInfo.actionTime = endTime;
	    							oneSignInfo.userAction = result;
	    							oneSignInfo.userComments = comment;
	            					pzUser = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("fnd0UserId");
	    							TCComponentUser tccomponentuser = UserList.getUser(session, "(" + pzUser + ")");
	    							if (tccomponentuser != null) {
	    								pzUser = tccomponentuser.toString();
	    								oneSignInfo.userName = pzUser;
	    							}
	    							System.out.println("oneSignInfo中taskName="+taskName+";user="+pzUser+";endTime="+endTime+";result="+result);
	    							vector_infor.add(oneSignInfo);
    							}
//            					else if(taskType.equals("EPMRouteTask")){
//    								ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct4[] = aprocesshistoryauditrecordstruct3[m].childrenAuditRecords;
//    								if(aprocesshistoryauditrecordstruct4.length > 0){
//    									taskName = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("object_name");
//    									getComment( aprocesshistoryauditrecordstruct4[aprocesshistoryauditrecordstruct4.length-1], templateName, taskName );
//    								}
//    							}
            					else{
    								taskName = aprocesshistoryauditrecordstruct3[m].auditRecord.getProperty("object_name");
    								getComment( aprocesshistoryauditrecordstruct3[m], templateName, taskName );
//    								vector_infor.add(oneSignInfo);
    							}
            				}
						
							System.out.println("taskName="+taskName+";user="+pzUser+";endTime="+endTime+";result="+result);
						} catch (TCException e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
            		}
            	}
            }
        }
        System.out.println("--------------------------------------------------------------");
		for (int i = 0; i < vector_infor.size(); i++) {
			String taskName1 = ((SignInfo) vector_infor.elementAt(i)).taskName.trim();
			String userAction = ((SignInfo) vector_infor.elementAt(i)).userAction;
			System.out.println("taskName="+taskName1+";userAction="+userAction);
		}
		System.out.println("--------------------------------------------------------------");
    }
	
	private String getComment( ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct, String templateName, String taskName ){
		
		String pzUser = "";
		int cnt = 0;
//		String taskName = "";
//		try {
//			taskName = aprocesshistoryauditrecordstruct.auditRecord.getProperty("object_name");
//		} catch (TCException e1) {
//			// TODO Auto-generated catch block
//			e1.printStackTrace();
//		}
		System.out.println("-----------------------------00");
		ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct1[] = aprocesshistoryauditrecordstruct.childrenAuditRecords;
		if( aprocesshistoryauditrecordstruct1 != null ){
			System.out.println("aprocesshistoryauditrecordstruct1.length="+aprocesshistoryauditrecordstruct1.length);
			if(aprocesshistoryauditrecordstruct1.length > 1){
				try {
					TCComponentFnd0AuditLog auditRecord = aprocesshistoryauditrecordstruct1[aprocesshistoryauditrecordstruct1.length - 1].auditRecord;
					if(auditRecord.getProperty("fnd0EventTypeName").equals("提升")){
//						SignInfo oneSignInfo = new SignInfo();
//						oneSignInfo.actionTime = auditRecord.getProperty("fnd0LoggedDate");
//						oneSignInfo.userAction = auditRecord.getProperty("fnd0EventTypeName");
//						oneSignInfo.userComments = auditRecord.getProperty("fnd0Comments");
//						oneSignInfo.processName = templateName;
//						oneSignInfo.taskName = taskName;
//						pzUser = auditRecord.getProperty("fnd0UserId");
//						TCComponentUser tccomponentuser = UserList.getUser(session, "(" + pzUser + ")");
//						if (tccomponentuser != null) {
//							pzUser = tccomponentuser.toString();
//							oneSignInfo.userName = pzUser;
//						}
//						System.out.println("getComment中taskName="+taskName+";user="+pzUser+";endTime="+oneSignInfo.actionTime+";result="+oneSignInfo.userAction );
//						vector_infor.add(oneSignInfo);
						auditRecord = aprocesshistoryauditrecordstruct.auditRecord;
						TCComponent[] valid_signoffs = auditRecord.getReferenceProperty("fnd0Object").getReferenceListProperty("valid_signoffs");
						for(int ix = 0; ix < valid_signoffs.length; ix++ ){
							SignInfo oneSignInfo = new SignInfo();
							oneSignInfo.actionTime = valid_signoffs[ix].getProperty("decision_date");
							oneSignInfo.userAction = valid_signoffs[ix].getProperty("decision");
							if(oneSignInfo.userAction.endsWith("89")){
								oneSignInfo.userAction = "认可";
							}
							oneSignInfo.userComments = valid_signoffs[ix].getProperty("comments");
							oneSignInfo.processName = templateName;
							oneSignInfo.taskName = taskName;
							oneSignInfo.userName = valid_signoffs[ix].getProperty("fnd0Assignee");
							System.out.println("getComment中taskName="+taskName+";user="+pzUser+";endTime="+oneSignInfo.actionTime+";result="+oneSignInfo.userAction );
							vector_infor.add(oneSignInfo);
						}
					}else{
						ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct2[] = aprocesshistoryauditrecordstruct1[aprocesshistoryauditrecordstruct1.length - 1].childrenAuditRecords;
						for(cnt = 0; cnt < aprocesshistoryauditrecordstruct2.length; cnt++){
							SignInfo oneSignInfo = new SignInfo();
							
								oneSignInfo.actionTime = aprocesshistoryauditrecordstruct2[cnt].auditRecord.getProperty("fnd0LoggedDate");
								oneSignInfo.userAction = aprocesshistoryauditrecordstruct2[cnt].auditRecord.getProperty("fnd0EventTypeName");
								oneSignInfo.userComments = aprocesshistoryauditrecordstruct2[cnt].auditRecord.getProperty("fnd0Comments");
								oneSignInfo.processName = templateName;
								oneSignInfo.taskName = taskName;
								pzUser = aprocesshistoryauditrecordstruct2[cnt].auditRecord.getProperty("fnd0UserId");
								TCComponentUser tccomponentuser = UserList.getUser(session, "(" + pzUser + ")");
								if (tccomponentuser != null) {
									pzUser = tccomponentuser.toString();
									oneSignInfo.userName = pzUser;
								}
								System.out.println("getComment中taskName="+taskName+";user="+pzUser+";endTime="+oneSignInfo.actionTime+";result="+oneSignInfo.userAction );
								vector_infor.add(oneSignInfo);
						}
					}
				} catch (TCException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
//		else{
//			try {
//				comment = aprocesshistoryauditrecordstruct.auditRecord.getProperty("fnd0Comments");
//			} catch (TCException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//		}
		
		return "";
	}
//	private void loadProcessHistoryData(com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct[], List list)
//    {
//        com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct1[];
//        int j = (aprocesshistoryauditrecordstruct1 = aprocesshistoryauditrecordstruct).length;
//        System.out.println("j="+j);
//        for(int i = 0; i < j; i++)
//        {
//            com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct processhistoryauditrecordstruct = aprocesshistoryauditrecordstruct1[i];
//            BaseProcessHistoryEntry baseprocesshistoryentry = new BaseProcessHistoryEntry();
//            if(processhistoryauditrecordstruct.auditRecord != null)
//            {
//            	try {
//					System.out.println("1----"+processhistoryauditrecordstruct.auditRecord.getProperty("object_name"));
//				} catch (TCException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				}
//                baseprocesshistoryentry.setComponent(processhistoryauditrecordstruct.auditRecord);
//                list.add(baseprocesshistoryentry);
//                ArrayList arraylist = new ArrayList();
//                com.teamcenter.rac.kernel.TCComponentFnd0SecondaryAudit atccomponentfnd0secondaryaudit[] = processhistoryauditrecordstruct.secondaryAuditRecords;
//                com.teamcenter.rac.kernel.TCComponentFnd0SecondaryAudit atccomponentfnd0secondaryaudit1[];
//                int l = (atccomponentfnd0secondaryaudit1 = atccomponentfnd0secondaryaudit).length;
//                for(int k = 0; k < l; k++)
//                {
//                    com.teamcenter.rac.kernel.TCComponentFnd0SecondaryAudit tccomponentfnd0secondaryaudit = atccomponentfnd0secondaryaudit1[k];
//                    baseprocesshistoryentry = new BaseProcessHistoryEntry();
//                    baseprocesshistoryentry.setComponent(tccomponentfnd0secondaryaudit);
//                    arraylist.add(baseprocesshistoryentry);
//                    try {
//						System.out.println("2----"+tccomponentfnd0secondaryaudit.getProperty("object_name"));
//					} catch (TCException e) {
//						// TODO Auto-generated catch block
//						e.printStackTrace();
//					}
//                }
//
//                com.fnd0.services.internal.rac.auditmanager._2012_09.ProcessHistoryManagement.ProcessHistoryAuditRecordStruct aprocesshistoryauditrecordstruct2[] = processhistoryauditrecordstruct.childrenAuditRecords;
//                loadProcessHistoryData(aprocesshistoryauditrecordstruct2, ((List) (arraylist)));
//                baseprocesshistoryentry.setChildEntries(arraylist);
//            }
//        }
//
//    }
	
	public void run() {
		try {
			InterfaceAIFComponent ainterfaceaifcomponent[] = myuiapp.getTargetComponents();
			if (ainterfaceaifcomponent != null) {
		        
				if (ainterfaceaifcomponent.length > 1) {
					MessageBox messagebox = new MessageBox("您只能选择一个对象！", "提示", MessageBox.WARNING);
					messagebox.setModal(true);
					messagebox.setVisible(true);
					return;
				}
				if (ainterfaceaifcomponent[0] != null) {
					if ((ainterfaceaifcomponent[0] instanceof TCComponentItemRevision) || (ainterfaceaifcomponent[0] instanceof TCComponentTask) || 
							(ainterfaceaifcomponent[0] instanceof TCComponentDataset) || (ainterfaceaifcomponent[0] instanceof TCComponentForm)
						|| (ainterfaceaifcomponent[0] instanceof TCComponentFolder)) {
						// 我现在只是针对： TCComponentItemRevision, TCComponentTask,
						// TCComponentDataset, TCComponentForm 这几个对象
						if (!(ainterfaceaifcomponent[0] instanceof TCComponentTask)) {
							TCComponent com = (TCComponent) ainterfaceaifcomponent[0];
							AIFComponentContext[] aif = com.whereReferenced();
							if (aif != null && aif.length > 0) {
								List<TCComponentTask> listProcess = new ArrayList<TCComponentTask>();
								for (int j = 0; j < aif.length; j++) {
									TCComponent tccomponent = (TCComponent) aif[j].getComponent();
									if (tccomponent instanceof TCComponentTask) {
										System.out.println("----");
										System.out.println("object_name="+((TCComponentTask) tccomponent).getProperty("object_name"));
										listProcess.add((TCComponentTask) tccomponent);
									}
								}
								if(listProcess.size()>0){
									viewWfInfo(listProcess,ainterfaceaifcomponent[0]);
								}else{
									MessageBox messagebox = new MessageBox("当前对象无引用流程！！！", "提示", MessageBox.WARNING);
									messagebox.setModal(true);
									messagebox.setVisible(true);
								}
								
							}else{
								MessageBox messagebox = new MessageBox("当前对象无引用流程！！！", "提示", MessageBox.WARNING);
								messagebox.setModal(true);
								messagebox.setVisible(true);
							}
						} else {
							if (ainterfaceaifcomponent[0] instanceof TCComponentTask) {
								viewWfInfo(ainterfaceaifcomponent[0]);
							}
						}
					} else {
						MessageBox messagebox = new MessageBox("请选择正确类型的对象！", "提示", MessageBox.WARNING);
						messagebox.setModal(true);
						messagebox.setVisible(true);
						return;
					}
				} else {
					MessageBox messagebox = new MessageBox("请选择对象！", "提示", MessageBox.WARNING);
					messagebox.setModal(true);
					messagebox.setVisible(true);
					return;
				}
			}
		}
		catch (Exception exception) {
			exception.printStackTrace();
		}
	}

	public void viewWfInfo(List<TCComponentTask> listProcess, InterfaceAIFComponent ainterfaceaifcomponent) {
		System.out.println("viewWfInfo(List<TCComponentProcess> listProcess)...........viewWfInfo");
		taskNameVector = new Vector<String>();
		smallTitleList = new ArrayList<String>();
		tableTitleVector = new Vector<String>();
		Vector<String> fileNameVector = new Vector<String>();
		for(int j=0;j<listProcess.size();j++){
			try {
				TCComponentTask tccomponenttask = listProcess.get(j).getRoot();
				//System.out.println("tccomponenttask="+tccomponenttask);
				TCComponentTask tccomponent_root_task = tccomponenttask.getRoot();
				//System.out.println("tccomponent_root_task="+tccomponent_root_task);
				AIFComponentContext[] aif = tccomponent_root_task.getChildren("child_tasks");//change by -*-*-, old getChildren()
				//System.out.println("aif.length = "+aif.length);
				for (int i = 0; i < aif.length; i++) {
					if (aif[i].getComponent() instanceof TCComponentTask) {
						TCComponentTask task = (TCComponentTask) aif[i].getComponent();
						if (task.getPrevious() == null) {
							firstTaskName = task.toString();
							System.out.println("firstTaskName = "+firstTaskName);
							taskNameVector.add(firstTaskName);
							break;
						}
					}
				}
				getNextTask(aif);

				String stringInformation = tccomponenttask.getAuditInfo(true);// 此函数的值就是系统调用后所得到的值
				System.out.println("stringInformation = "+stringInformation);

				String fileName = "D:\\流程审核"+j+".txt";
				// 把获得的信息写到一个文本文件里面
				writeToText(fileName, stringInformation);

				fileNameVector.add(fileName);
				
			} catch (TCException e) {
				e.printStackTrace();
			}
		}
		
		// 读取某一个文本文件的信息
		//Vector<SignInfo> vector_infor = readerFromText(fileNameVector);
		vector_infor = new Vector<SignInfo>();
		vector_infor = readerFromText(fileNameVector);
		readInfo( ainterfaceaifcomponent );
		System.out.println("--------------------------------------------------------------");
		for (int i = 0; i < vector_infor.size(); i++) {
			String taskName = ((SignInfo) vector_infor.elementAt(i)).taskName.trim();
			String userAction = ((SignInfo) vector_infor.elementAt(i)).userAction;
			System.out.println("taskName="+taskName+";userAction="+userAction);
		}
		System.out.println("--------------------------------------------------------------");
		Object[][] objData = null;
		objData = getDataAuditing(vector_infor, taskNameVector);
		QueryTaskOpinionTableHead tableHeadTestPanel = new QueryTaskOpinionTableHead();
		tableHeadTestPanel.setAutoscrolls(true);
		//tableHeadTestPanel.settitleArray(smallTitleList);
		//更改显示模式 2011.4.22
		tableHeadTestPanel.setobjArray(objData);
		tableHeadTestPanel.setTableHeadTestModel(tableTitleVector);
		tableHeadTestPanel.initColumnSizes();
		String processName = null;
		try {
			processName = listProcess.get(0).getRoot().getProperty("job_name");
		} catch (TCException e) {
			e.printStackTrace();
		}// 流程名
		String processCreator = null;
		try {
			processCreator = listProcess.get(0).getRoot().getProperty("owning_user");
		} catch (TCException e) {
			e.printStackTrace();
		}// 流程创建者
		String processCreateDate = null;
		try {
			processCreateDate = listProcess.get(0).getRoot().getProperty("creation_date");
		} catch (TCException e) {
			e.printStackTrace();
		}// 流程创建时间
		JFrame frame = new JFrame("流程名：" + processName + "    流程创建者:" + processCreator + "    流程创建时间:" + processCreateDate);
		tableHeadTestPanel.setOpaque(true); // content panes
		JScrollPane scrollPane = new JScrollPane(tableHeadTestPanel);
		scrollPane.setAutoscrolls(true);
		frame.setContentPane(scrollPane);
		frame.pack();
		frame.setLocation(200, 100);
		frame.setVisible(true);
		
	}

	public void viewWfInfo(InterfaceAIFComponent interfaceaifcomponent_top) {
		System.out.println("viewWfInfo(InterfaceAIFComponent interfaceaifcomponent_top)...........viewWfInfo");
		if (interfaceaifcomponent_top instanceof TCComponentTask) {
			TCComponentTask tccomponenttask = (TCComponentTask) interfaceaifcomponent_top;
			taskNameVector = new Vector<String>();
			smallTitleList = new ArrayList<String>();
			tableTitleVector = new Vector<String>();
			try {
				TCComponentTask tccomponent_root_task = tccomponenttask.getRoot();
//				AIFComponentContext[] aif = tccomponent_root_task.getChildren();//remove by -*-*- 
				AIFComponentContext[] aif = tccomponent_root_task.getChildren("child_tasks");
				for (int i = 0; i < aif.length; i++) {
					if (aif[i].getComponent() instanceof TCComponentTask) {
						TCComponentTask task = (TCComponentTask) aif[i].getComponent();
						if (task.getPrevious() == null) {
							firstTaskName = task.toString();
							taskNameVector.add(firstTaskName);
							break;
						}
					}
				}
				getNextTask(aif);

				String stringInformation = tccomponenttask.getAuditInfo(true);// 此函数的值就是系统调用后所得到的值

				String fileName = "D:\\流程审核.txt";
				// 把获得的信息写到一个文本文件里面
				writeToText(fileName, stringInformation);
				// 读取某一个文本文件的信息
//				Vector<SignInfo> vector_infor = readerFromText(fileName);
				vector_infor = new Vector<SignInfo>();
				vector_infor = readerFromText(fileName);
				readInfo( tccomponenttask );
				Object[][] objData = null;
				objData = getDataAuditing(vector_infor, taskNameVector);
				QueryTaskOpinionTableHead tableHeadTestPanel = new QueryTaskOpinionTableHead();
				tableHeadTestPanel.setAutoscrolls(true);
				//tableHeadTestPanel.settitleArray(smallTitleList);
				//更改显示模式 2011.4.22
				tableHeadTestPanel.setobjArray(objData);
				tableHeadTestPanel.setTableHeadTestModel(tableTitleVector);
				tableHeadTestPanel.initColumnSizes();
				String processName = tccomponenttask.getProperty("job_name");// 流程名
				String processCreator = tccomponenttask.getProperty("owning_user");// 流程创建者
				String processCreateDate = tccomponenttask.getProperty("creation_date");// 流程创建时间
				JFrame frame = new JFrame("流程名：" + processName + "    流程创建者:" + processCreator + "    流程创建时间:" + processCreateDate);
				tableHeadTestPanel.setOpaque(true); // content panes
				JScrollPane scrollPane = new JScrollPane(tableHeadTestPanel);
				scrollPane.setAutoscrolls(true);
				frame.setContentPane(scrollPane);
				frame.pack();
				frame.setLocation(200, 100);
				frame.setVisible(true);
			}
			catch (TCException e2) {
				e2.printStackTrace();
			}
		} else {
			MessageBox.post("流传审核选择的对象不对，请重新选择", "提示", MessageBox.INFORMATION);
		}
	}

	/*
	 * 按照流程走向顺序依次遍历查找相对应的"子流程"
	 */
	public void getNextTask(AIFComponentContext[] aif) {
		for (int i = 0; i < aif.length; i++) {
			InterfaceAIFComponent interfaceaifcomponent = aif[i].getComponent();
			//System.out.println("interfaceaifcomponent.getType()"+interfaceaifcomponent.getType());
			if (interfaceaifcomponent instanceof TCComponentTask) {
				//System.out.println("---------------getNextTask------------------");
				if ((interfaceaifcomponent.getType().equals("EPMAcknowledgeTask"))) {
					AcknowladgeTaskList.add(interfaceaifcomponent.toString());
					if (!taskNameVector.contains(interfaceaifcomponent.toString())) {
						taskNameVector.addElement(interfaceaifcomponent.toString());
					}
				}
				if ((interfaceaifcomponent.getType().equals("EPMReviewTask"))) {
					reviewTaskList.add(interfaceaifcomponent.toString());
					if (!taskNameVector.contains(interfaceaifcomponent.toString())) {
						taskNameVector.addElement(interfaceaifcomponent.toString());
					}
				}
				if ((interfaceaifcomponent.getType().equals("EPMDoTask"))) {
					doTaskList.add(interfaceaifcomponent.toString());
					if (!taskNameVector.contains(interfaceaifcomponent.toString())) {
						taskNameVector.addElement(interfaceaifcomponent.toString());
					}
				}
				if ((interfaceaifcomponent.getType().equals("EPMConditionTask"))) {
					conditionTaskList.add(interfaceaifcomponent.toString());
					if (!taskNameVector.contains(interfaceaifcomponent.toString())) {
						taskNameVector.addElement(interfaceaifcomponent.toString());
					}
				}
				if ((interfaceaifcomponent.getType().equals("EPMAddStatusTask"))) {
					addStatusTaskList.add(interfaceaifcomponent.toString());
					if (!taskNameVector.contains(interfaceaifcomponent.toString())) {
						taskNameVector.addElement(interfaceaifcomponent.toString());
					}
				}
				if ((interfaceaifcomponent.getType().equals("EPMRouteTask"))) {
					RouteTaskList.add(interfaceaifcomponent.toString());
					if (!taskNameVector.contains(interfaceaifcomponent.toString())) {
						taskNameVector.addElement(interfaceaifcomponent.toString());
					}
				}
			}
		}
	}

	/*
	 * 构造表中数据
	 */
	public Object[][] getDataAuditing(Vector<SignInfo> vector_infor, Vector<String> taskNameVector1) {
		// System.out.println("taskNameVector.............." + taskNameVector);
		// System.out.println("vector_infor.............." +
		// vector_infor.size());
		int columWidth = 0;
		if (vector_infor != null) {
			columWidth = 6 + 1;
		}

		Object[][] objData = new Object[vector_infor.size() + 1][columWidth];
		if (vector_infor.size() == 0) {
			objData = new Object[vector_infor.size() + 1][columWidth];
			tableTitleVector.add(firstTaskName + "(首任务)");
			for (int j = 0; j < firstTaskTitle.length; j++) {
				smallTitleList.add(firstTaskTitle[j]);
			}
		}
		// 代表行
		int countNum = 0;
		if ((vector_infor != null) && (vector_infor.size() > 0)) {
			boolean isRefused = false;
			String taskName = "";
			String userAction = "";
			for (int i = 0; i < vector_infor.size(); i++) {
				taskName = ((SignInfo) vector_infor.elementAt(i)).taskName.trim();
				userAction = ((SignInfo) vector_infor.elementAt(i)).userAction;
				System.out.println("taskName="+taskName+";userAction="+userAction);
				//if (taskNameVector.contains(taskName)) {
					if (userAction.equals("Completed") || userAction.equalsIgnoreCase("true") || userAction.equalsIgnoreCase("false")||userAction.equals("完成")) {//userAction.equals("完成")
						if (taskName.equals(firstTaskName.trim())) {
							if (!tableTitleVector.contains(firstTaskName + "(首任务)")) {
								tableTitleVector.add(firstTaskName + "(首任务)");
								for (int j = 0; j < firstTaskTitle.length; j++) {
									smallTitleList.add(firstTaskTitle[j]);
								}
							}
							isRefused = false;
							objData[i][0] = ((SignInfo) vector_infor.elementAt(i)).processName;
							objData[i][1] = ((SignInfo) vector_infor.elementAt(i)).taskName;
							if(userAction.equals("Completed"))
								objData[i][2] = "完成";
							else if(userAction.equalsIgnoreCase("true"))
								objData[i][2] = "是";
							else if(userAction.equalsIgnoreCase("false"))
								objData[i][2] = "否";
							objData[i][3] = ((SignInfo) vector_infor.elementAt(i)).userName;
							objData[i][4] = ((SignInfo) vector_infor.elementAt(i)).actionTime;
							objData[i][5] = ((SignInfo) vector_infor.elementAt(i)).userComments;
						} else {
							if ((doTaskList.contains(taskName)) || (conditionTaskList.contains(taskName) || addStatusTaskList.contains(taskName))) {
								int col = 0;
								if (doTaskList.contains(taskName)) {
									if (!tableTitleVector.contains("【DOTask】" + taskName)) {
										tableTitleVector.add("【DOTask】" + taskName);
										for (int j = 0; j < doAndConditionTaskTitle.length; j++) {
											smallTitleList.add(doAndConditionTaskTitle[j]);
										}
									}
									col = tableTitleVector.indexOf("【DOTask】" + taskName);
							} else if (conditionTaskList.contains(taskName)) {
								if (!tableTitleVector.contains("【ConditionTask】" + taskName)) {
									tableTitleVector.add("【ConditionTask】"+ taskName);
									for (int j = 0; j < doAndConditionTaskTitle.length; j++) {
										smallTitleList.add(doAndConditionTaskTitle[j]);
									}
								}
								col = tableTitleVector.indexOf("【ConditionTask】" + taskName);
							} else if (addStatusTaskList.contains(taskName)) {
								if (!tableTitleVector.contains("【AddStatusTask】" + taskName)) {
									tableTitleVector.add("【AddStatusTask】"+ taskName);
									for (int j = 0; j < doAndConditionTaskTitle.length; j++) {
										smallTitleList.add(doAndConditionTaskTitle[j]);
									}
								}
								col = tableTitleVector.indexOf("【AddStatusTask】" + taskName);
							}
								if (isRefused) {
									for (int m = col + 1; m < columWidth; m++) {
										objData[i][m] = "";
									}
								}

								isRefused = false;
								objData[i][0] = ((SignInfo) vector_infor.elementAt(i)).processName;
								objData[i][1] = ((SignInfo) vector_infor.elementAt(i)).taskName;
								if(userAction.equals("Completed"))
									objData[i][2] = "完成";
								else if(userAction.equalsIgnoreCase("true"))
									objData[i][2] = "是";
								else if(userAction.equalsIgnoreCase("false"))
									objData[i][2] = "否";
								objData[i][3] = ((SignInfo) vector_infor.elementAt(i)).userName;
								objData[i][4] = ((SignInfo) vector_infor.elementAt(i)).actionTime;
								objData[i][5] = ((SignInfo) vector_infor.elementAt(i)).userComments;
							}
						}
					} else if ((userAction.equals("Rejected")||userAction.equals("拒绝"))) {//userAction.equals("拒绝")
						if ((reviewTaskList.contains(taskName)) || (AcknowladgeTaskList.contains(taskName))) {
							if (!tableTitleVector.contains(taskName)) {
								tableTitleVector.add(taskName);
								for (int j = 0; j < auditingTitle.length; j++) {
									smallTitleList.add(auditingTitle[j]);
								}
							} else {
								if (AcknowladgeTaskList.contains(taskName)) {
									tableTitleVector.add(taskName);
									for (int j = 0; j < notifyTitle.length; j++) {
										smallTitleList.add(notifyTitle[j]);
									}
								}
							}
							int col = tableTitleVector.indexOf(taskName);
							objData[i][0] = ((SignInfo) vector_infor.elementAt(i)).processName;
							objData[i][1] = ((SignInfo) vector_infor.elementAt(i)).taskName;
							//objData[i][2] = ((SignInfo) vector_infor.elementAt(i)).userAction;
							objData[i][2] = "拒绝";
							objData[i][3] = ((SignInfo) vector_infor.elementAt(i)).userName;
							objData[i][4] = ((SignInfo) vector_infor.elementAt(i)).actionTime;
							objData[i][5] = ((SignInfo) vector_infor.elementAt(i)).userComments;
							++countNum;
							isRefused = true;
						}
					} else if (userAction.equals("Approved")||userAction.equals("批准") || (userAction.equals("认可"))) {//(userAction.equals("批准")) || (userAction.equals("认可"))
						if ((reviewTaskList.contains(taskName)) || (AcknowladgeTaskList.contains(taskName)) || RouteTaskList.contains(taskName)) {
							if (!tableTitleVector.contains(taskName)) {
								if (reviewTaskList.contains(taskName)) {
									tableTitleVector.add(taskName);
									for (int j = 0; j < auditingTitle.length; j++) {
										smallTitleList.add(auditingTitle[j]);
									}
								} else {
									if (AcknowladgeTaskList.contains(taskName)) {
										tableTitleVector.add(taskName);
										for (int j = 0; j < notifyTitle.length; j++) {
											smallTitleList.add(notifyTitle[j]);
										}
									}
								}
							}
							int col = tableTitleVector.indexOf(taskName);
							// 目的：如果是拒绝后的，将其所在列后面的清空
							if (isRefused) {
								// 目的：如果是拒绝后的，将其所在列后面的清空
								for (int m = col + 1; m < columWidth; m++) {
									objData[i][m] = "";
								}
							}
							isRefused = false;
							objData[i][0] = ((SignInfo) vector_infor.elementAt(i)).processName;
							objData[i][1] = ((SignInfo) vector_infor.elementAt(i)).taskName;
							//objData[i][2] = ((SignInfo) vector_infor.elementAt(i)).userAction;
							objData[i][2] = "批准";
							objData[i][3] = ((SignInfo) vector_infor.elementAt(i)).userName;
							objData[i][4] = ((SignInfo) vector_infor.elementAt(i)).actionTime;
							objData[i][5] = ((SignInfo) vector_infor.elementAt(i)).userComments;
						}
					}else if(userAction.equals("提升") || userAction.equals("skipped")){
						if ( AcknowladgeTaskList.contains(taskName)) {
							if (!tableTitleVector.contains(taskName)) {
								if (reviewTaskList.contains(taskName)) {
									tableTitleVector.add(taskName);
									for (int j = 0; j < auditingTitle.length; j++) {
										smallTitleList.add(auditingTitle[j]);
									}
								} else {
									if (AcknowladgeTaskList.contains(taskName)) {
										tableTitleVector.add(taskName);
										for (int j = 0; j < notifyTitle.length; j++) {
											smallTitleList.add(notifyTitle[j]);
										}
									}
								}
							}
							int col = tableTitleVector.indexOf(taskName);
							// 目的：如果是拒绝后的，将其所在列后面的清空
							if (isRefused) {
								// 目的：如果是拒绝后的，将其所在列后面的清空
								for (int m = col + 1; m < columWidth; m++) {
									objData[i][m] = "";
								}
							}
							isRefused = false;
							objData[i][0] = ((SignInfo) vector_infor.elementAt(i)).processName;
							objData[i][1] = ((SignInfo) vector_infor.elementAt(i)).taskName;
							//objData[i][2] = ((SignInfo) vector_infor.elementAt(i)).userAction;
							objData[i][2] = "提升";
							objData[i][3] = ((SignInfo) vector_infor.elementAt(i)).userName;
							objData[i][4] = ((SignInfo) vector_infor.elementAt(i)).actionTime;
							objData[i][5] = ((SignInfo) vector_infor.elementAt(i)).userComments;
						}
					}else{//add by -*-*- 
						if (!tableTitleVector.contains(taskName)) {
							if (reviewTaskList.contains(taskName)) {
								tableTitleVector.add(taskName);
								for (int j = 0; j < auditingTitle.length; j++) {
									smallTitleList.add(auditingTitle[j]);
								}
							} else {
								if (AcknowladgeTaskList.contains(taskName)) {
									tableTitleVector.add(taskName);
									for (int j = 0; j < notifyTitle.length; j++) {
										smallTitleList.add(notifyTitle[j]);
									}
								}
							}
						}
						int col = tableTitleVector.indexOf(taskName);
						// 目的：如果是拒绝后的，将其所在列后面的清空
						if (isRefused) {
							// 目的：如果是拒绝后的，将其所在列后面的清空
							for (int m = col + 1; m < columWidth; m++) {
								objData[i][m] = "";
							}
						}
						isRefused = false;
						objData[i][0] = ((SignInfo) vector_infor.elementAt(i)).processName;
						objData[i][1] = ((SignInfo) vector_infor.elementAt(i)).taskName;
						objData[i][2] = ((SignInfo) vector_infor.elementAt(i)).userAction;
						//objData[i][2] = "开始";
						objData[i][3] = ((SignInfo) vector_infor.elementAt(i)).userName;
						objData[i][4] = ((SignInfo) vector_infor.elementAt(i)).actionTime;
						objData[i][5] = ((SignInfo) vector_infor.elementAt(i)).userComments;
					}
				//}
			}
		}
		return objData;
	}

	/**
	 * 把字符流数据写入一个文本文件里面(writeToText) *************流程处理
	 */
	public void writeToText(String fileName, String stringInformation) {
		PrintWriter pw;
		try {
			pw = new PrintWriter(new FileWriter(fileName));
			pw.println(stringInformation);
			pw.close();
		}
		catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 从一个文本文件里面读取信息(readerFromText) *************流程处理
	 */
	public Vector<SignInfo> readerFromText(String fileName) {
		System.out.println("readerFromText(String) - start"); //$NON-NLS-1$
		BufferedReader br = null;
		Vector<SignInfo> vs = new Vector<SignInfo>();
		try {
			int num = 1;
			br = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
			String strLine = null;							
			String processName = "";			
			while ((strLine = br.readLine()) != null) {		
				if((strLine.startsWith("流程模板名"))){
					System.out.println("strLine=="+strLine);
					String [] temps = strLine.split(" ");
					int y=0;
					System.out.println(" temps.length=="+ temps.length);
					for (int i = 0; i < temps.length; i++) {
						if (temps[i].trim().length() != 0) {
							++y;
							if (y == 2) {
								processName = temps[i].trim();//获得流程名称
							}			
						}
					}
					System.out.println("processName=="+processName);
				}else if ((strLine.startsWith("完成")) || (strLine.startsWith("拒绝")) || (strLine.startsWith("批准")) ) {//|| (strLine.startsWith("提升"))
						String[] temp = strLine.split(" ");
						int k = 0;
						String taskName = "";
						String pzUser = "";
						String pzTime = "";

						for (int i = 0; i < temp.length; i++) {
							if (temp[i].trim().length() != 0) {
								++k;
								if (k == 2) {
									taskName = temp[i].trim();
								}
								if (k == 3) {
									pzTime = temp[i].trim();
								}
								if (k == 4) {
									pzTime = pzTime + " " + temp[i].trim();
								}
								if (k == 5) {
									pzUser = temp[i].trim();
									break;
								}
							}
						}

						try {
							TCComponentUser tccomponentuser1 = UserList.getUser(session, "(" + pzUser + ")");
							if (tccomponentuser1 != null) {
								pzUser = tccomponentuser1.toString();
							}
						}
						catch (TCException e) {
							e.printStackTrace();
						}

						SignInfo oneSignInfo = new SignInfo();

						oneSignInfo.userName = pzUser;
						oneSignInfo.actionTime = pzTime;
						if(num==1){
							oneSignInfo.processName = processName;
						}else{
							oneSignInfo.processName = "";
						}

						if ((strLine.startsWith("完成"))) {
							oneSignInfo.taskName = taskName;
							if (taskNameVector.contains(taskName)) {
								if (strLine.startsWith("完成")) {
									oneSignInfo.userAction = "完成";
									if ((!reviewTaskList.contains(taskName)) && (!AcknowladgeTaskList.contains(taskName))) {
										br.readLine();
										br.mark(400);
										strLine = br.readLine();
										if (!(strLine.startsWith(" ") || strLine.startsWith("\t"))) {
											br.reset();
										} else {
											String Comments = strLine.trim();
											while((strLine = br.readLine()) != null){
												if(strLine.equals("")){
													break;
												}else{
													Comments = Comments + "\t"+strLine.trim();
												}
											}
											oneSignInfo.userComments = Comments;
										}
										oneSignInfo.num = num++;
										vs.add(oneSignInfo);
									}
								}
							}
						} else {
							if ((strLine.startsWith("批准"))) {
								oneSignInfo.userAction = "批准";
							} else {
								oneSignInfo.userAction = "拒绝";
							}
							strLine = br.readLine();
							temp = strLine.split(":");
							taskName = temp[1].trim();
							if (taskNameVector.contains(taskName)) {
								oneSignInfo.taskName = taskName;
								if (AcknowladgeTaskList.contains(taskName)) {
									oneSignInfo.userAction = "认可";
								}
								br.mark(400);
								strLine = br.readLine();
								if (!(strLine.startsWith(" ") || strLine.startsWith("\t"))) {
									br.reset();
								} else {
									String Comments = strLine.trim();
									while((strLine = br.readLine()) != null){
										if(strLine.equals("")){
											break;
										}else{
											Comments = Comments + "\t"+strLine.trim();
										}
									}
									oneSignInfo.userComments = Comments;
								}
								oneSignInfo.num = num++;
								vs.add(oneSignInfo);
							}
						}
					}
				}
				br.close();
			}
			catch (FileNotFoundException e1) {
				e1.printStackTrace();
			}
			catch (IOException e2) {
				e2.printStackTrace();
			}
		System.out.println("readerFromText(String) - end" + vs.size()); //$NON-NLS-1$
		return vs;
	}
	

	/**
	 * 从一个文本文件里面读取信息(readerFromText) *************流程处理
	 */
	public Vector<SignInfo> readerFromText(Vector<String> fileNameVector) {
		System.out.println("readerFromText(String) - start"); //$NON-NLS-1$
		BufferedReader br = null;
		Vector<SignInfo> vs = new Vector<SignInfo>();
		for(int n = 0; n < fileNameVector.size(); n++){
			int num = 1;
			try {
				br = new BufferedReader(new InputStreamReader(new FileInputStream(fileNameVector.get(n))));
				String strLine = null;							
				String processName = "";			
				while ((strLine = br.readLine()) != null) {		
					if((strLine.startsWith("流程模板名"))){
						System.out.println("strLine=="+strLine);
						String [] temps = strLine.split(" ");
						int y=0;
						System.out.println(" temps.length=="+ temps.length);
						for (int i = 0; i < temps.length; i++) {
							if (temps[i].trim().length() != 0) {
								++y;
								if (y == 2) {
									processName = temps[i].trim();//获得流程名称
								}			
							}
						}
						System.out.println("processName=="+processName);
					}else
					if ((strLine.startsWith("完成")) || (strLine.startsWith("拒绝")) || (strLine.startsWith("批准"))) {
						String[] temp = strLine.split(" ");
						int k = 0;
						String taskName = "";
						String pzUser = "";
						String pzTime = "";

						for (int i = 0; i < temp.length; i++) {
							if (temp[i].trim().length() != 0) {
								++k;
								if (k == 2) {
									taskName = temp[i].trim();
								}
								if (k == 3) {
									pzTime = temp[i].trim();
								}
								if (k == 4) {
									pzTime = pzTime + " " + temp[i].trim();
								}
								if (k == 5) {
									pzUser = temp[i].trim();
									break;
								}
							}
						}

						try {
							TCComponentUser tccomponentuser1 = UserList.getUser(session, "(" + pzUser + ")");
							if (tccomponentuser1 != null) {
								pzUser = tccomponentuser1.toString();
							}
						}
						catch (TCException e) {
							e.printStackTrace();
						}

						SignInfo oneSignInfo = new SignInfo();

						oneSignInfo.userName = pzUser;
						oneSignInfo.actionTime = pzTime;
						if(num==1){
							oneSignInfo.processName = processName;
						}else{
							oneSignInfo.processName = "";
						}
						

						if ((strLine.startsWith("完成"))) {
							oneSignInfo.taskName = taskName;
							if (taskNameVector.contains(taskName)) {
								if (strLine.startsWith("完成")) {
									oneSignInfo.userAction = "完成";
									if ((!reviewTaskList.contains(taskName)) && (!AcknowladgeTaskList.contains(taskName))) {
										br.readLine();
										br.mark(400);
										strLine = br.readLine();
										if (!(strLine.startsWith(" ") || strLine.startsWith("\t"))) {
											br.reset();
										} else {
											String Comments = strLine.trim();
											while((strLine = br.readLine()) != null){
												if(strLine.equals("")){
													break;
												}else{
													Comments = Comments + "\t"+strLine.trim();
												}
											}
											oneSignInfo.userComments = Comments;
										}
										oneSignInfo.num = num++;
										vs.add(oneSignInfo);
									}
								}
							}
						} else {
							if ((strLine.startsWith("批准"))) {
								oneSignInfo.userAction = "批准";
							} else {
								oneSignInfo.userAction = "拒绝";
							}
							strLine = br.readLine();
							temp = strLine.split(":");
							taskName = temp[1].trim();
							if (taskNameVector.contains(taskName)) {
								oneSignInfo.taskName = taskName;
								if (AcknowladgeTaskList.contains(taskName)) {
									oneSignInfo.userAction = "认可";
								}
								br.mark(400);
								strLine = br.readLine();
								if (!(strLine.startsWith(" ") || strLine.startsWith("\t"))) {
									br.reset();
								} else {
									String Comments = strLine.trim();
									while((strLine = br.readLine()) != null){
										if(strLine.equals("")){
											break;
										}else{
											Comments = Comments + "\t"+strLine.trim();
										}
									}
									oneSignInfo.userComments = Comments;
								}
								oneSignInfo.num = num++;
								vs.add(oneSignInfo);
							}
						}
					}
				}
				br.close();
			}
			catch (FileNotFoundException e1) {
				e1.printStackTrace();
			}
			catch (IOException e2) {
				e2.printStackTrace();
			}
		}
		
		System.out.println("readerFromText(String) - end" + vs.size()); //$NON-NLS-1$
		return vs;
	}

	// 读取一个文本文件需要建立的一个静态类
	static class SignInfo {
		public String   processName     = "";
		public int   	num     = 0;
		public String	taskName		= "";
		public String	userName		= "";
		public String	userAction		= "";
		public String	actionTime		= "";
		public String	userComments	= "";
	}

	private TCSession					session	= null;
	private AbstractAIFUIApplication	myuiapp;
}
