📄 applyfunction.java
字号:
package com.qiny.leave;
import java.util.Map;
import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.workflow.FunctionProvider;
import com.opensymphony.workflow.spi.WorkflowEntry;
import com.qiny.dao.LeaveDAO;
import org.apache.log4j.Logger;
public class ApplyFunction implements FunctionProvider {
private static Logger logger = (Logger) Logger.getInstance(ApplyFunction.class);
public void execute(Map transientVars, Map args, PropertySet ps) {
logger.info("execute ......");
WorkflowEntry entry = (WorkflowEntry) transientVars.get("entry");
long wfid = entry.getId();
int actionId = ((Integer) transientVars.get("actionId")).intValue();
logger.info("execute actionId=" + actionId);
String applicant = (String) transientVars.get("applicant");
String reason = (String) transientVars.get("reason");
int dayCount = ((Integer) transientVars.get("dayCount")).intValue();
LeaveApply leaveApply = new LeaveApply(applicant, reason, dayCount);
leaveApply.setWfid(wfid);
LeaveDAO leaveDao = new LeaveDAO();
leaveDao.addLeaveApply(leaveApply);
ps.setInt("dayCount", dayCount);
logger.info("execute leaveDao has added leaveApply!");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -