|
|
|
|
package weaver.interfaces.workflow.action.javacode;
|
|
|
|
|
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.interfaces.workflow.action.Action;
|
|
|
|
|
import weaver.general.BaseBean;
|
|
|
|
|
import weaver.soa.workflow.request.RequestInfo;
|
|
|
|
|
/**
|
|
|
|
|
* Online custom action interface
|
|
|
|
|
*/
|
|
|
|
|
public class Action20241024024705 extends BaseBean implements Action{
|
|
|
|
|
/**
|
|
|
|
|
* After selecting aciton after the process path node, this method will be executed after the node is submitted.
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public String execute(RequestInfo request) {
|
|
|
|
|
/*
|
|
|
|
|
* Process custom interface code example
|
|
|
|
|
*
|
|
|
|
|
* 1:Log
|
|
|
|
|
* writeLog("in my online edited action");
|
|
|
|
|
*
|
|
|
|
|
* 2:Exception
|
|
|
|
|
* boolean error=true;
|
|
|
|
|
* if(error) {
|
|
|
|
|
* request.getRequestManager().setMessageid("90001");
|
|
|
|
|
* request.getRequestManager().setMessagecontent("System Abnormal Termination Process Submission!");
|
|
|
|
|
* }
|
|
|
|
|
*
|
|
|
|
|
* 3:Get requestid
|
|
|
|
|
* String requestId = request.getRequestid();
|
|
|
|
|
*
|
|
|
|
|
* 4:Get form tableName
|
|
|
|
|
* String tablename = request.getRequestManager().getBillTableName();
|
|
|
|
|
*
|
|
|
|
|
* 5:Find form content
|
|
|
|
|
* RecordSet rs = new RecordSet();
|
|
|
|
|
* rs.execute("select * from "+tablename+" where requestid = "+requestId);
|
|
|
|
|
* rs.next();
|
|
|
|
|
* String mainid = rs.getString("id"); //id:Form primary key
|
|
|
|
|
* String formData = rs.getString("formData"); //formData:Field name for form design
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
String requestId = request.getRequestid();
|
|
|
|
|
String tablename = request.getRequestManager().getBillTableName();
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
rs.execute("select * from "+tablename+" where requestid = "+requestId);
|
|
|
|
|
rs.next();
|
|
|
|
|
String mainid = rs.getString("id");
|
|
|
|
|
String rcid = rs.getString("rcid");
|
|
|
|
|
String rcjsr = rs.getString("rcjsr");
|
|
|
|
|
rs.executeUpdate("delete from workplan where id = ? and resourceid= ? ",rcid,rcjsr);
|
|
|
|
|
return Action.SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|