Skip to content

Commit

Permalink
- updating bam to use domainId instead of sessionId
Browse files Browse the repository at this point in the history
  • Loading branch information
salaboy authored and mswiderski committed Mar 26, 2013
1 parent 33457fc commit 0d4bd2d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
Expand Up @@ -56,7 +56,7 @@ public class NodeInstanceLog implements Serializable, AuditEvent {
private String nodeType;
private Long workItemId;
private String connection;
private Integer sessionId;
private String domainId;

NodeInstanceLog() {
}
Expand Down Expand Up @@ -161,7 +161,7 @@ public int hashCode() {
result = prime * result
+ ((connection == null) ? 0 : connection.hashCode());
result = prime * result
+ ((sessionId == null) ? 0 : sessionId.hashCode());
+ ((domainId == null) ? 0 : domainId.hashCode());
return result;
}

Expand Down Expand Up @@ -219,10 +219,10 @@ public boolean equals(Object obj) {
} else if (!connection.equals(other.connection))
return false;

if (sessionId == null) {
if (other.sessionId != null)
if (domainId == null) {
if (other.domainId != null)
return false;
} else if (!sessionId.equals(other.sessionId))
} else if (!domainId.equals(other.domainId))
return false;
return true;
}
Expand All @@ -243,12 +243,12 @@ public void setConnection(String connection) {
this.connection = connection;
}

public int getSessionId() {
return sessionId;
public String getDomainId() {
return domainId;
}

public void setSessionId(int sessionId) {
this.sessionId = sessionId;
public void setDomainId(String domainId) {
this.domainId = domainId;
}

public String getNodeType() {
Expand Down
Expand Up @@ -57,11 +57,11 @@ public class ProcessInstanceLog implements Serializable, AuditEvent {
private String outcome;
private Long duration;
private String identity;
private Integer sessionId;
private String domainId;
private String processVersion;
private String processName;

ProcessInstanceLog() {
public ProcessInstanceLog() {
}

public ProcessInstanceLog(long processInstanceId, String processId) {
Expand Down Expand Up @@ -129,7 +129,7 @@ public int hashCode() {
result = prime * result + ((outcome == null) ? 0 : outcome.hashCode());
result = prime * result + ((duration == null) ? 0 : duration.hashCode());
result = prime * result + ((identity == null) ? 0 : identity.hashCode());
result = prime * result + ((sessionId == null) ? 0 : sessionId.hashCode());
result = prime * result + ((domainId == null) ? 0 : domainId.hashCode());
result = prime * result + ((processVersion == null) ? 0 : processVersion.hashCode());
result = prime * result + ((processName == null) ? 0 : processName.hashCode());
return result;
Expand Down Expand Up @@ -194,10 +194,10 @@ public boolean equals(Object obj) {
} else if (!identity.equals(other.identity))
return false;

if (sessionId == null) {
if (other.sessionId != null)
if (domainId == null) {
if (other.domainId != null)
return false;
} else if (!sessionId.equals(other.sessionId))
} else if (!domainId.equals(other.domainId))
return false;

if (processVersion == null) {
Expand Down Expand Up @@ -254,12 +254,12 @@ public void setIdentity(String identity) {
this.identity = identity;
}

public Integer getSessionId() {
return sessionId;
public String getDomainId() {
return domainId;
}

public void setSessionId(Integer sessionId) {
this.sessionId = sessionId;
public void setDomainId(String domainId) {
this.domainId = domainId;
}

public String getProcessVersion() {
Expand Down
Expand Up @@ -49,7 +49,7 @@ public class VariableInstanceLog implements Serializable, AuditEvent {
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "log_date")
private Date date;
private Integer sessionId;
private String domainId;

VariableInstanceLog() {
}
Expand Down Expand Up @@ -135,12 +135,12 @@ void setDate(Date date) {
this.date = date;
}

public Integer getSessionId() {
return sessionId;
public String getDomainId() {
return domainId;
}

public void setSessionId(Integer sessionId) {
this.sessionId = sessionId;
public void setDomainId(String domainId) {
this.domainId = domainId;
}

public String toString() {
Expand All @@ -160,7 +160,7 @@ public int hashCode() {
result = prime * result + ((oldValue == null) ? 0 : oldValue.hashCode());
result = prime * result + ((variableId == null) ? 0 : variableId.hashCode());
result = prime * result + ((variableInstanceId == null) ? 0 : variableInstanceId.hashCode());
result = prime * result + ((sessionId == null) ? 0 : sessionId.hashCode());
result = prime * result + ((domainId == null) ? 0 : domainId.hashCode());
return result;
}

Expand Down Expand Up @@ -207,10 +207,10 @@ public boolean equals(Object obj) {
return false;
} else if (!variableInstanceId.equals(other.variableInstanceId))
return false;
if (sessionId == null) {
if (other.sessionId != null)
if (domainId == null) {
if (other.domainId != null)
return false;
} else if (!sessionId.equals(other.sessionId))
} else if (!domainId.equals(other.domainId))
return false;
return true;
}
Expand Down
Expand Up @@ -23,7 +23,7 @@ public class DefaultAuditEventBuilderImpl implements AuditEventBuilder {
public AuditEvent buildEvent(ProcessStartedEvent pse) {
ProcessInstanceImpl pi = (ProcessInstanceImpl) pse.getProcessInstance();
ProcessInstanceLog log = new ProcessInstanceLog(pi.getId(), pi.getProcessId());
log.setSessionId(((KieSession) pse.getKieRuntime()).getId());
log.setDomainId(""+((KieSession) pse.getKieRuntime()).getId());
log.setProcessName(pi.getProcess().getName());
log.setProcessVersion(pi.getProcess().getVersion());
log.setStatus(ProcessInstance.STATE_ACTIVE);
Expand Down Expand Up @@ -75,7 +75,7 @@ public AuditEvent buildEvent(ProcessNodeTriggeredEvent pnte) {
}
String connection = (String)nodeInstance.getMetaData().get("IncomingConnection");
log.setConnection(connection);
log.setSessionId(((KieSession) pnte.getKieRuntime()).getId());
log.setDomainId(""+((KieSession) pnte.getKieRuntime()).getId());
log.setNodeType(nodeType);
return log;
}
Expand Down Expand Up @@ -107,7 +107,7 @@ public AuditEvent buildEvent(ProcessNodeLeftEvent pnle, Object log) {
}
String connection = (String)nodeInstance.getMetaData().get("OutgoingConnection");
logEvent.setConnection(connection);
logEvent.setSessionId(((KieSession) pnle.getKieRuntime()).getId());
logEvent.setDomainId(""+((KieSession) pnle.getKieRuntime()).getId());
logEvent.setNodeType(nodeType);
return logEvent;
}
Expand All @@ -122,7 +122,7 @@ public AuditEvent buildEvent(ProcessVariableChangedEvent pvce) {
String newValue = (pvce.getNewValue() != null)?pvce.getNewValue().toString():"";
VariableInstanceLog log = new VariableInstanceLog(
processInstanceId, processId, variableInstanceId, variableId, newValue, oldValue);
log.setSessionId(((KieSession) pvce.getKieRuntime()).getId());
log.setDomainId(""+((KieSession) pvce.getKieRuntime()).getId());
return log;
}

Expand Down

0 comments on commit 0d4bd2d

Please sign in to comment.