1 25 package org.ofbiz.shark.requester; 26 27 import java.util.Map ; 28 29 import org.ofbiz.entity.GenericValue; 30 import org.ofbiz.service.GenericRequester; 31 import org.ofbiz.service.ModelService; 32 33 import org.enhydra.shark.api.SharkTransaction; 34 import org.enhydra.shark.api.client.wfbase.BaseException; 35 import org.enhydra.shark.api.client.wfmodel.InvalidPerformer; 36 import org.enhydra.shark.api.client.wfmodel.WfEventAudit; 37 38 44 public class SimpleRequester extends AbstractRequester { 45 46 public static final String module = SimpleRequester.class.getName(); 47 protected GenericRequester req = null; 48 protected ModelService model = null; 49 50 public SimpleRequester(GenericValue userLogin, ModelService model, GenericRequester req) { 52 super(userLogin); 53 this.model = model; 54 this.setServiceRequester(req); 55 56 } 57 58 public SimpleRequester(GenericValue userLogin, ModelService model) { 59 this(userLogin, model, null); 60 } 61 62 66 public void receive_event(WfEventAudit event) throws BaseException, InvalidPerformer { 67 if (this.req != null) { 68 Map out = model.makeValid(this.getWRD(event, null), ModelService.OUT_PARAM); 69 req.receiveResult(out); 70 } 71 } 72 73 public void receive_event(SharkTransaction sharkTransaction, WfEventAudit event) throws BaseException, InvalidPerformer { 74 this.receive_event(event); 75 } 76 77 81 public void setServiceRequester(GenericRequester req) { 82 this.req = req; 83 } 84 85 public GenericRequester getServiceRequester() { 86 return this.req; 87 } 88 } 89 | Popular Tags |