/**
   * Retrieves workpackage parametes as {@link ProcessInfoParameter} list:
   *
   * <ul>
   *   <li>parameters which were directly set to workpackage (i.e. {@link
   *       I_C_Queue_WorkPackage_Param})
   *   <li>fallback: parameters which were set to creator AD_PInstance_ID
   * </ul>
   *
   * @param workpackage
   * @return
   */
  private List<ProcessInfoParameter> retrieveWorkpackageProcessInfoParameters(
      final I_C_Queue_WorkPackage workpackage) {
    Check.assumeNotNull(workpackage, "workpackage not null");

    final Map<String, ProcessInfoParameter> workpackagesParamsMap = new HashMap<>();

    //
    // Load parameters from creator's AD_PInstance_ID
    {
      final Properties ctx = InterfaceWrapperHelper.getCtx(workpackage);
      final int adPInstanceId = extractAD_PInstance_ID(workpackage);
      final IADPInstanceDAO adPInstanceDAO = Services.get(IADPInstanceDAO.class);
      for (final ProcessInfoParameter param :
          adPInstanceDAO.retrieveProcessInfoParameters(ctx, adPInstanceId)) {
        workpackagesParamsMap.put(param.getParameterName(), param);
      }
    }

    //
    // Load parameters which are directly set to this workpackage
    // NOTE: this will OVERRIDE AD_PInstance level parameters
    for (final I_C_Queue_WorkPackage_Param workpackageParam :
        retrieveWorkpackageParametersList(workpackage)) {
      final ProcessInfoParameter param = createProcessInfoParameter(workpackageParam);
      workpackagesParamsMap.put(param.getParameterName(), param);
    }

    return new ArrayList<>(workpackagesParamsMap.values());
  }
Esempio n. 2
0
 @Override
 protected void prepare() {
   for (final ProcessInfoParameter para : getParameter()) {
     final String name = para.getParameterName();
     if (para.getParameter() == null) ;
     else if ("Target_Directory".equals(name)) p_Target_Directory = (String) para.getParameter();
     else if ("EntityType".equals(name)) p_EntityType = (String) para.getParameter();
   }
 }
 /** Prepare - e.g., get Parameters. */
 protected void prepare() {
   ProcessInfoParameter[] paramaters = getParameter();
   for (ProcessInfoParameter para : paramaters) {
     String name = para.getParameterName();
     if (para.getParameter() == null) ;
     else if (name.equals("IsImportOnlyNoErrors"))
       p_IsImportOnlyNoErrors = "Y".equals(para.getParameter());
     else if (name.equals("DeleteOldImported"))
       p_DeleteOldImported = "Y".equals(para.getParameter());
     else log.log(Level.SEVERE, "Unknown Parameter: " + name);
   }
 } //	prepare
  @Override
  /** Obtener los parametros */
  protected void prepare() {

    ProcessInfoParameter[] parameter = getParameter();

    for (ProcessInfoParameter element : parameter) {

      if (element.getParameter() != null) {
        if (element.getParameterName().equals("FileName")) {
          archivo = element.getParameter().toString();
        }
      }
    }
  }
  /** Prepare - e.g., get Parameters. */
  protected void prepare() {

    for (ProcessInfoParameter para : getParameter()) {
      String name = para.getParameterName();
      if (para.getParameter() == null) ;
      else if (name.equals(X_M_Product.COLUMNNAME_M_Product_ID)) {
        p_M_Product_ID = para.getParameterAsInt();
      } else if (name.equals(X_M_Warehouse.COLUMNNAME_M_Warehouse_ID)) {
        p_M_Warehouse_ID = para.getParameterAsInt();
      } else if (name.equals("DateTrx")) {
        p_DateTrx = (Timestamp) para.getParameter();
      } else if (name.equals(X_PP_Order_BOMLine.COLUMNNAME_QtyRequired)) {
        p_QtyRequiered = (BigDecimal) para.getParameter();
      } else if (name.equals(X_PP_Product_BOMLine.COLUMNNAME_BackflushGroup)) {
        p_BackflushGroup = (String) para.getParameter();
      } else if (name.equals(X_T_BOMLine.COLUMNNAME_LevelNo)) {
        p_LevelNo = para.getParameterAsInt();
      } else log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);
    }
  } // prepare
  /** Prepare - e.g., get Parameters. */
  protected void prepare() {
    ProcessInfoParameter[] parameters = getParameter();
    for (ProcessInfoParameter parameter : parameters) {
      String name = parameter.getParameterName();
      if (parameter.getParameter() == null) ;
      else if (name.equals("DateValue")) {
        p_DateValue = (Timestamp) parameter.getParameter();
        if (p_DateValue == null) throw new FillMandatoryException("@DateValue@");

      } else if (name.equals(MWarehouse.COLUMNNAME_M_Warehouse_ID))
        p_M_Warehouse_ID = parameter.getParameterAsInt();
      else if (name.equals(MCostDetail.COLUMNNAME_M_Product_ID))
        p_M_Product_ID = parameter.getParameterAsInt();
      else if (name.equals(MProduct.COLUMNNAME_M_Product_Category_ID))
        p_M_Product_Category_ID = parameter.getParameterAsInt();
      else if (name.equals(MCostDetail.COLUMNNAME_M_CostType_ID))
        p_M_CostType_ID = parameter.getParameterAsInt();
      else if (name.equals(MCostDetail.COLUMNNAME_M_CostElement_ID))
        p_M_CostElement_ID = parameter.getParameterAsInt();
    }
  } //	prepare