Advertisement
tko_pb

ProcessDocumentReactiveHandlerAction

Sep 7th, 2018
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.50 KB | None | 0 0
  1. package org.wirabumi.gen.oez.event;
  2.  
  3. import java.util.List;
  4.  
  5. import org.openbravo.base.model.ModelProvider;
  6. import org.openbravo.base.secureApp.VariablesSecureApp;
  7. import org.openbravo.dal.service.OBDal;
  8. import org.openbravo.model.ad.ui.Tab;
  9. import org.openbravo.base.model.Entity;
  10. import org.openbravo.base.structure.BaseOBObject;
  11.  
  12.  
  13. public class ProcessDocumentReactiveHandlerAction extends DocumentRoutingHandlerAction {
  14.     private final String processed="processed";
  15.    
  16.     @Override
  17.     public void doRouting(String adWindowId, String adTabId, String doc_status_to, VariablesSecureApp vars,
  18.             List<String> recordId) {
  19.         // dari tabId dapatkan tableID
  20.         Tab tab = OBDal.getInstance().get(Tab.class, adTabId);
  21.         String tableId = tab.getTable().getId();
  22.         Entity entity = ModelProvider.getInstance().getEntityByTableId(tableId);
  23.  
  24.         for (int i = 0; i < recordId.size(); i++) {
  25.             BaseOBObject objek = OBDal.getInstance().get(entity.toString(), recordId.get(i));
  26.             objek.set(processed, false);
  27.             OBDal.getInstance().save(objek);
  28.         }
  29.         try {
  30.             OBDal.getInstance().commitAndClose();
  31.         } catch (Exception e) {
  32.             e.printStackTrace();
  33.         }
  34.     }
  35.    
  36.     @Override
  37.     public Boolean updateDocumentStatus(Entity entity, List<String> RecordId, String document_status_to,
  38.             String column) {
  39.         return super.updateDocumentStatus(entity, RecordId, document_status_to, column);
  40.     }
  41.  
  42.     @Override
  43.     public String getCoDocumentNo(String recordID, Tab tab) {
  44.         // TODO Auto-generated method stub
  45.         return null;
  46.     }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement