Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.wirabumi.gen.oez.event;
- import java.util.List;
- import org.openbravo.base.model.ModelProvider;
- import org.openbravo.base.secureApp.VariablesSecureApp;
- import org.openbravo.dal.service.OBDal;
- import org.openbravo.model.ad.ui.Tab;
- import org.openbravo.base.model.Entity;
- import org.openbravo.base.structure.BaseOBObject;
- public class ProcessDocumentReactiveHandlerAction extends DocumentRoutingHandlerAction {
- private final String processed="processed";
- @Override
- public void doRouting(String adWindowId, String adTabId, String doc_status_to, VariablesSecureApp vars,
- List<String> recordId) {
- // dari tabId dapatkan tableID
- Tab tab = OBDal.getInstance().get(Tab.class, adTabId);
- String tableId = tab.getTable().getId();
- Entity entity = ModelProvider.getInstance().getEntityByTableId(tableId);
- for (int i = 0; i < recordId.size(); i++) {
- BaseOBObject objek = OBDal.getInstance().get(entity.toString(), recordId.get(i));
- objek.set(processed, false);
- OBDal.getInstance().save(objek);
- }
- try {
- OBDal.getInstance().commitAndClose();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- @Override
- public Boolean updateDocumentStatus(Entity entity, List<String> RecordId, String document_status_to,
- String column) {
- return super.updateDocumentStatus(entity, RecordId, document_status_to, column);
- }
- @Override
- public String getCoDocumentNo(String recordID, Tab tab) {
- // TODO Auto-generated method stub
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement