You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB
Java

2 years ago
package weaver.interfaces.workflow.action.javacode;
import weaver.conn.RecordSet;
import weaver.conn.RecordSetTrans;
import weaver.general.StringUtil;
import weaver.interfaces.workflow.action.Action;
import weaver.general.BaseBean;
import weaver.soa.workflow.request.RequestInfo;
/**
* Online custom action interface
* ()
*/
public class Action20231027045935 extends BaseBean implements Action{
/**
* After selecting aciton after the process path node, this method will be executed after the node is submitted.
*/
public static final String updateReqLevel = "update workflow_requestbase set requestlevel = 2 where requestid= ?";
public String execute(RequestInfo request) {
//1:Log
writeLog("in my online edited action");
//2Exception
// boolean error=true;
// if(error) {
// request.getRequestManager().setMessageid("90001");
// request.getRequestManager().setMessagecontent("System Abnormal Termination Process Submission");
// }
//3Get requestid
String requestId = request.getRequestid();
if(StringUtil.isEmpty(requestId)){
return Action.SUCCESS;
}
RecordSetTrans rs = request.getRequestManager() .getRsTrans();
try {
rs.setAutoCommit(false);
rs.executeUpdate(updateReqLevel,requestId);
int updateCount = rs.getUpdateCount();
writeLog("更新条数==>",updateCount);
if(updateCount > 1){
rs.rollback();
}else{
rs.commit();
}
} catch (Exception e) {
rs.rollback();
e.printStackTrace();
}
return Action.SUCCESS;
}
}