public class TransCtrlFilter extends ProcessFilterAdapter {
@Override
public void activityCreate(AbstractFlowEvent event, ActivityInst destActInst) {
if(event instanceof ActivityCreateEvent) {
IActivityInstRepository actInstRep = event.getActInstRep();
ActivityInst srcActInst = ((ActivityCreateEvent)event).getActivityInst();
//调用startActivityInst方法直接启动环节
if(srcActInst == null)
srcActInst = destActInst;
TransCtrl transCtrl = new TransCtrl();
transCtrl.setSrcActDefId(srcActInst.getActivityDefId());
transCtrl.setSrcActDefName(srcActInst.getActivityInstName());
transCtrl.setSrcActType(srcActInst.getActivityType());
transCtrl.setDestActDefId(destActInst.getActivityDefId());
transCtrl.setDestActDefName(destActInst.getActivityInstName());
transCtrl.setDestActType(destActInst.getActivityType());
transCtrl.setTransTime(new Date());
transCtrl.setProcessInstId(destActInst.getProcessInstId());
transCtrl.setIsUse("N");
transCtrl.setIsStartDestAct("N");
long transCtrlId = PrimaryKeyUtil.getPrimaryKey(Keys.TRANSCTRLID);
transCtrl.setTransCtrlId(transCtrlId);
actInstRep.insertTransCtrl(transCtrl);
}
}