Example #1
0
  public IPrintingService findPrintingService(final ProcessInfo pi) {
    final Properties ctx = Env.getCtx();
    final int AD_Client_ID = Env.getAD_Client_ID(ctx);
    final int AD_Org_ID = Env.getAD_Org_ID(ctx);
    final int AD_Role_ID = Env.getAD_Role_ID(ctx);
    final int AD_User_ID = Env.getAD_User_ID(ctx);
    final int AD_Process_ID = pi.getAD_Process_ID();
    final int C_DocType_ID =
        Services.get(IDocActionBL.class).getC_DocType_ID(ctx, pi.getTable_ID(), pi.getRecord_ID());
    final String printerType = null;

    return findPrintingService0(
        ctx,
        AD_Client_ID,
        AD_Org_ID,
        AD_Role_ID,
        AD_User_ID,
        C_DocType_ID,
        AD_Process_ID,
        printerType);
  }
Example #2
0
  /**
   * Async Process - Do it all. <code>
   * - Get Instance ID
   * - Get Parameters
   * - execute (lock - start process - unlock)
   *  </code> Creates a ProcessCtl instance, which calls lockUI and unlockUI if parent is a
   * ASyncProcess <br>
   * Called from ProcessCtl.startProcess, ProcessDialog.actionPerformed, APanel.cmd_print,
   * APanel.actionButton, VPaySelect.cmd_generate
   *
   * @param parent ASyncProcess & Container
   * @param WindowNo window no
   * @param pi ProcessInfo process info
   * @param trx Transaction
   * @return worker started ProcessCtl instance or null for workflow
   */
  public static WProcessCtl process(
      Object parent, int WindowNo, ProcessInfo pi, Trx trx, HttpServletRequest request) {
    log.fine("WindowNo=" + WindowNo + " - " + pi);
    WebSessionCtx wsc = WebSessionCtx.get(request);
    MPInstance instance = new MPInstance(wsc.ctx, pi.getAD_Process_ID(), pi.getRecord_ID());

    if (!instance.save()) {
      pi.setSummary(Msg.getMsg(wsc.ctx, "ProcessNoInstance"));
      pi.setError(true);
      return null;
    }
    pi.setAD_PInstance_ID(instance.getAD_PInstance_ID());

    //	Get Parameters (Dialog)
    /**
     * ProcessParameter para = new ProcessParameter (Env.getFrame((Container)parent), WindowNo, pi);
     * if (para.initDialog()) { para.setVisible(true); if (!para.isOK()) { pi.setSummary
     * (Msg.getMsg(Env.getCtx(), "ProcessCancelled")); pi.setError (true); return null; } }
     */
    //	execute
    WProcessCtl worker = new WProcessCtl(parent, pi, trx, wsc.ctx);
    worker.start(); // 	MUST be start!
    return worker;
  } //	execute