ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.vci.server.workflow.event;
 
import java.io.Serializable;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.api.model.OpenProcessInstance;
 
import com.vci.common.log.ServerWithLog4j;
import com.vci.corba.common.VCIError;
import com.vci.corba.omd.data.BusinessObject;
import com.vci.server.base.utility.ServerServiceProvider;
 
 
/**
 * 流程事件基础结构
 * @author xiongchao
 *
 */
public abstract class BaseEvent implements EventListener, Serializable{
 
    /**
     * 
     */
    private static final long serialVersionUID = 7558509386989455685L;
 
    private EventListenerExecution ele = null;
    private OpenProcessInstance opi = null;
    private String[] objIds = null;
    private String btmName = null;
    @Override
    public void notify(EventListenerExecution e) throws Exception {
        try{
            setEle(e);
            setOpi(e.getProcessInstance());
            setObjIds((String[])e.getProcessInstance().getVariable("objId"));
            setBtmName((String)e.getProcessInstance().getVariable("boType"));
            doEvent(e);
        }catch(VCIError ex){
            ServerWithLog4j.logger.error(ex);
            throw ex;
        }catch(Exception ex){
            ServerWithLog4j.logger.error(ex);
            throw ex;
        }
    }
    
    public abstract void doEvent(EventListenerExecution e) throws Exception;
    
    
    public BusinessObject[] getBusinessObjects() throws VCIError{
        return ServerServiceProvider.getBOFService().getBatchBusinessObject(objIds, btmName);
    }
    
    public EventListenerExecution getEle() {
        return ele;
    }
    public void setEle(EventListenerExecution ele) {
        this.ele = ele;
    }
    public OpenProcessInstance getOpi() {
        return opi;
    }
    public void setOpi(OpenProcessInstance opi) {
        this.opi = opi;
    }
 
    public String[] getObjIds() {
        return objIds;
    }
 
    public void setObjIds(String[] objIds) {
        this.objIds = objIds;
    }
 
    public String getBtmName() {
        return btmName;
    }
 
    public void setBtmName(String btmName) {
        this.btmName = btmName;
    }
 
    
}