📄 processlist.bsh
字号:
import java.util.*;import org.ofbiz.base.util.*;import org.ofbiz.shark.container.*;import org.ofbiz.shark.requester.*;import org.enhydra.shark.api.client.wfservice.*;import org.enhydra.shark.api.client.wfmodel.*;userLogin = session.getAttribute("userLogin");// get the admin toolsadmin = SharkContainer.getAdminInterface();exMgr = admin.getExecutionAdministration();if (userLogin == null) { request.setAttribute("_ERROR_MESSAGE_", "UserLogin object not found."); return;}// connect to the engineexMgr.connect(userLogin.getString("userLoginId"), userLogin.getString("currentPassword"), null, null);// enabled state codecontext.put("enabledCode", process_mgr_stateType._enabled);// create a processif (request.getParameter("create") != null) { mgrName = request.getParameter("create"); try { mgr = exMgr.getProcessMgr(mgrName); if (mgr != null) { LoggingRequester req = new LoggingRequester(userLogin); WfProcess proc = mgr.create_process(req); req.addPerformer(proc); proc.start(); } } catch (Exception e) { request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); }}// disable the mgrif (request.getParameter("disable") != null) { mgrName = request.getParameter("disable"); try { mgr = exMgr.getProcessMgr(mgrName); if (mgr != null) { disabledType = process_mgr_stateType.from_int(process_mgr_stateType._disabled); mgr.set_process_mgr_state(disabledType); } } catch (Exception e) { request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); }}// enable the mgrif (request.getParameter("enable") != null) { mgrName = request.getParameter("enable"); try { mgr = exMgr.getProcessMgr(mgrName); if (mgr != null) { enabledType = process_mgr_stateType.from_int(process_mgr_stateType._enabled); mgr.set_process_mgr_state(enabledType); } } catch (Exception e) { request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); }}// get the process managerspi = exMgr.get_iterator_processmgr();if (pi != null) { mgrList = new ArrayList(); size = pi.how_many(); mgrs = pi.get_next_n_sequence(size); Debug.log("Mgrs : " + mgrs.length); context.put("processMgrs", Arrays.asList(mgrs));}// disconnect from the engineexMgr.disconnect();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -