1 package org.enhydra.shark; 2 3 4 import org.enhydra.shark.api.SharkTransaction; 5 import org.enhydra.shark.api.TransactionException; 6 import org.enhydra.shark.api.client.wfbase.BaseException; 7 import org.enhydra.shark.api.common.SharkConstants; 8 import org.enhydra.shark.api.internal.eventaudit.CreateProcessEventAuditPersistenceInterface; 9 import org.enhydra.shark.api.internal.eventaudit.EventAuditException; 10 import org.enhydra.shark.api.internal.eventaudit.EventAuditManagerInterface; 11 import org.enhydra.shark.api.internal.eventaudit.EventAuditPersistenceInterface; 12 import org.enhydra.shark.api.internal.working.WfActivityInternal; 13 import org.enhydra.shark.api.internal.working.WfCreateProcessEventAuditInternal; 14 import org.enhydra.shark.api.internal.working.WfProcessInternal; 15 import org.enhydra.shark.api.internal.working.WfRequesterInternal; 16 17 22 public class WfCreateProcessEventAuditWrapper extends WfEventAuditWrapper 23 implements WfCreateProcessEventAuditInternal { 24 25 private String pActivityId; 26 private String pProcessId; 27 private String pProcessName; 28 private String pProcessMgrName; 29 private String pProcessMgrVersion; 30 private String pActivityDefinitionId; 31 private String pActivitySetDefinitionId; 32 private String pProcessDefinitionId; 33 private String pPackageId; 34 35 protected WfCreateProcessEventAuditWrapper(SharkTransaction t,WfProcessInternal process,WfRequesterInternal requester) 36 throws BaseException { 37 super(t,process,SharkConstants.EVENT_PROCESS_CREATED); 38 39 try { 40 if ((requester!=null) && (requester instanceof WfActivityInternal)) { 41 WfActivityInternal req=(WfActivityInternal)requester; 42 pActivityId=req.key(t); 43 pProcessId=req.container(t).key(t); 44 pProcessName=req.container(t).name(t); 45 pProcessMgrName=req.container(t).manager_name(t); 46 pProcessMgrVersion=req.container(t).manager_version(t); 47 pActivityDefinitionId=req.activity_definition_id(t); 48 pActivitySetDefinitionId=req.activity_set_definition_id(t); 49 pProcessDefinitionId=req.container(t).process_definition_id(t); 50 pPackageId=req.container(t).package_id(t); 51 } 52 persist(t); 53 } catch (Exception pe) { 54 throw new BaseException(pe); 55 } 56 } 57 58 61 protected WfCreateProcessEventAuditWrapper (String userAuth,CreateProcessEventAuditPersistenceInterface po) { 62 super(userAuth,po); 63 } 64 65 public String p_activity_key () throws BaseException { 66 return pActivityId; 67 } 68 69 public String p_process_key () throws BaseException { 70 return pProcessId; 71 } 72 73 public String p_process_name () throws BaseException { 74 return pProcessName; 75 } 76 77 public String p_process_mgr_name () throws BaseException { 78 return pProcessMgrName; 79 } 80 81 public String p_process_mgr_version () throws BaseException { 82 return pProcessMgrVersion; 83 } 84 85 public String p_activity_definition_id () throws BaseException { 86 return pActivityDefinitionId; 87 } 88 89 public String p_activity_set_definition_id () throws BaseException { 90 return pActivitySetDefinitionId; 91 } 92 public String p_process_definition_id () throws BaseException { 93 return pProcessMgrVersion; 94 } 95 96 public String p_package_id () throws BaseException { 97 return pProcessMgrVersion; 98 } 99 100 public void persist (SharkTransaction t) throws TransactionException { 101 try { 102 EventAuditManagerInterface eam=SharkEngineManager.getInstance().getEventAuditManager(); 103 if (null == eam) 104 return; 105 CreateProcessEventAuditPersistenceInterface po= 106 eam.createCreateProcessEventAudit(); 107 fillPersistentObject(po); 108 eam.persist(po,t); 109 } catch (EventAuditException pe) { 110 throw new TransactionException(pe); 111 } 112 } 113 114 public void refresh () { 115 } 117 118 public void delete (SharkTransaction t) throws TransactionException { 119 } 121 122 protected void fillPersistentObject (EventAuditPersistenceInterface po) { 123 super.fillPersistentObject(po); 124 CreateProcessEventAuditPersistenceInterface cpo=(CreateProcessEventAuditPersistenceInterface)po; 125 cpo.setPActivityId(this.pActivityId); 126 cpo.setPProcessId(this.pProcessId); 127 cpo.setPProcessName(this.pProcessName); 128 cpo.setPProcessDefinitionName(this.pProcessMgrName); 129 cpo.setPProcessDefinitionVersion(this.pProcessMgrVersion); 130 cpo.setPActivityDefinitionId(this.pActivityDefinitionId); 131 cpo.setPActivitySetDefinitionId(this.pActivitySetDefinitionId); 132 cpo.setPProcessDefinitionId(this.pProcessDefinitionId); 133 cpo.setPPackageId(this.pPackageId); 134 } 135 136 protected void restore (EventAuditPersistenceInterface po) { 137 super.restore(po); 138 CreateProcessEventAuditPersistenceInterface cpo=(CreateProcessEventAuditPersistenceInterface)po; 139 this.pActivityId=cpo.getPActivityId(); 140 this.pProcessId=cpo.getPProcessId(); 141 this.pProcessName=cpo.getPProcessName(); 142 this.pProcessMgrName=cpo.getPProcessDefinitionName(); 143 this.pProcessMgrVersion=cpo.getPProcessDefinitionVersion(); 144 this.pActivityDefinitionId=cpo.getPActivityDefinitionId(); 145 this.pActivitySetDefinitionId=cpo.getPActivitySetDefinitionId(); 146 this.pProcessDefinitionId=cpo.getPProcessDefinitionId(); 147 this.pPackageId=cpo.getPPackageId(); 148 } 149 150 } 151 | Popular Tags |