解决难题JavaScript的!以下是代码?==帮我说说这端code的作用!
//Initialization TSN_WORKREQUIREMENTsender = WF_PROCESSINSTANCEEXECUTOR;
var org = new Packages.com.aboveE.powerProcess.organization.OrganizationServer();
var user = org.getUser(sender);
if (user != null){
senderName = "發件人" + user.getName();
}
var unitId = null;
if(applicant=="null" || applicant==null || applicant=="")
unitId = applicantUnit;
else
unitId = org.getUnitFromUser(applicant);
if(unitId==null || unitId=="") error="unitId is invalid.";
var i=0;
if(compId==null){
do{
unitId = org.getParentUnit(unitId);
if(unitId==null || unitId=="") error="unitId is invalid.";
unit = org.getUnit(unitId);
if(unit==null) error="unit is null.";
i++;
if(i>50){
error="unit level is invalid.";break;
}
}while(unit.getLevel()>1)
var compId = unit.getID();
}
mngExecuter=compId+"_MNG_TSNWR";
checkUser=compId+"_AUD_TSNWR";
mngManager=compId+"_MNGManager_TSNWR";
if(httpServer==null || httpServer=="")
httpServer ="http://10.5.1.2:6060";
flowDesc="工作需求申請單"+tsnwrNo+"; "+senderName;