protected Audit createAudit(ProcessInstance processInstance, TaskBase task) { Audit audit = new Audit(); audit.setCreated(new Timestamp(System.currentTimeMillis())); audit.setTaskId(task.getTaskId()); audit.setProcessDefinitionName(task.getOwnerProcess().getName()); audit.setComment(trimComment(task.toString())); audit.setHandler(task.getHandler()); audit.setInterrupted(false); audit.setLockedBy(processInstance.getLockedBy()); audit.setStatus(processInstance.getStatus()); audit.setParentId(processInstance.getId()); processInstance.getAudits().add(audit); return audit; } /* (non-Javadoc)
public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
private void dumpAuditTrail(ProcessInstance processInstance) { if (!log.isDebugEnabled()) { return; } for (Audit audit: processInstance.getAudits()) { log.debug("{} {} {} {} {} {} {}", audit.getId(),audit.getProcessDefinitionName(), audit.getTaskId(),audit.getStatus(),audit.getComment(),audit.isHandler(),audit.isInterrupted()); } }
theId = (true?this.getId(): 0L); strategy.appendField(locator, this, "id", buffer, theId); theParentId = (true?this.getParentId(): 0L); strategy.appendField(locator, this, "parentId", buffer, theParentId); theProcessDefinitionName = this.getProcessDefinitionName(); strategy.appendField(locator, this, "processDefinitionName", buffer, theProcessDefinitionName); theComment = this.getComment(); strategy.appendField(locator, this, "comment", buffer, theComment); theTaskId = this.getTaskId(); strategy.appendField(locator, this, "taskId", buffer, theTaskId); theHandler = this.isHandler(); strategy.appendField(locator, this, "handler", buffer, theHandler); theInterrupted = this.isInterrupted(); strategy.appendField(locator, this, "interrupted", buffer, theInterrupted); theCreated = this.getCreated(); strategy.appendField(locator, this, "created", buffer, theCreated); theStatus = this.getStatus(); strategy.appendField(locator, this, "status", buffer, theStatus); theLockedBy = this.getLockedBy(); strategy.appendField(locator, this, "lockedBy", buffer, theLockedBy);
ret.append(sb); ret.append("AUDIT: "); ret.append(audit.getStatus()); ret.append(" "); ret.append(audit.getComment()); ret.append(" handler:"); ret.append(audit.isHandler()); ret.append(" interrupted:"); ret.append(audit.isInterrupted()); ret.append(" taskId:"); ret.append(audit.getTaskId()); ret.append(" "); ret.append(audit.getComment()); ret.append("\n");
int lastAuditIndex = processInstance.getAudits().size()-1; Audit lastAudit = processInstance.getAudits().get(lastAuditIndex); lastAudit.setInterrupted(true); lastAudit.setStatus(TaskStatus.TIMEOUT); Date now = new Date(); lastAudit.setComment(trimComment(lastAudit.getComment()+" Timed out at "+now));
/** * Sets the value of the parentId property. * */ public void setParentId(long value) { getMetadata().removeUnknown("parentId"); if (m_validationSession!= null) { m_validationSession.set(this, "parentId", value, parentId); } this.parentId = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "parentId", value, parentId); } }
/** * Create an instance of {@link Audit } * */ public Audit createAudit() { return new Audit(); }
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
lhsId = (true?this.getId(): 0L); long rhsId; rhsId = (true?that.getId(): 0L); if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) { return false; lhsParentId = (true?this.getParentId(): 0L); long rhsParentId; rhsParentId = (true?that.getParentId(): 0L); if (!strategy.equals(LocatorUtils.property(thisLocator, "parentId", lhsParentId), LocatorUtils.property(thatLocator, "parentId", rhsParentId), lhsParentId, rhsParentId)) { return false; lhsProcessDefinitionName = this.getProcessDefinitionName(); String rhsProcessDefinitionName; rhsProcessDefinitionName = that.getProcessDefinitionName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "processDefinitionName", lhsProcessDefinitionName), LocatorUtils.property(thatLocator, "processDefinitionName", rhsProcessDefinitionName), lhsProcessDefinitionName, rhsProcessDefinitionName)) { return false; lhsComment = this.getComment(); String rhsComment; rhsComment = that.getComment(); if (!strategy.equals(LocatorUtils.property(thisLocator, "comment", lhsComment), LocatorUtils.property(thatLocator, "comment", rhsComment), lhsComment, rhsComment)) { return false; lhsTaskId = this.getTaskId(); Long rhsTaskId; rhsTaskId = that.getTaskId(); if (!strategy.equals(LocatorUtils.property(thisLocator, "taskId", lhsTaskId), LocatorUtils.property(thatLocator, "taskId", rhsTaskId), lhsTaskId, rhsTaskId)) { return false;
/** * Sets the value of the id property. * */ public void setId(long value) { getMetadata().removeUnknown("id"); if (m_validationSession!= null) { m_validationSession.set(this, "id", value, id); } this.id = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "id", value, id); } }
theId = (true?this.getId(): 0L); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId); theParentId = (true?this.getParentId(): 0L); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parentId", theParentId), currentHashCode, theParentId); theProcessDefinitionName = this.getProcessDefinitionName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "processDefinitionName", theProcessDefinitionName), currentHashCode, theProcessDefinitionName); theComment = this.getComment(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "comment", theComment), currentHashCode, theComment); theTaskId = this.getTaskId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "taskId", theTaskId), currentHashCode, theTaskId); theHandler = this.isHandler(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handler", theHandler), currentHashCode, theHandler); theInterrupted = this.isInterrupted(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "interrupted", theInterrupted), currentHashCode, theInterrupted); theCreated = this.getCreated(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "created", theCreated), currentHashCode, theCreated); theStatus = this.getStatus(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "status", theStatus), currentHashCode, theStatus); theLockedBy = this.getLockedBy(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "lockedBy", theLockedBy), currentHashCode, theLockedBy);
/** * Sets the value of the interrupted property. * * @param value * allowed object is * {@link Boolean } * */ public void setInterrupted(Boolean value) { getMetadata().removeUnknown("interrupted"); if (m_validationSession!= null) { m_validationSession.set(this, "interrupted", value, interrupted); } this.interrupted = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "interrupted", value, interrupted); } }
/** * Sets the value of the comment property. * * @param value * allowed object is * {@link String } * */ public void setComment(String value) { getMetadata().removeUnknown("comment"); if (m_validationSession!= null) { m_validationSession.set(this, "comment", value, comment); } this.comment = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "comment", value, comment); } }
/** * Sets the value of the status property. * * @param value * allowed object is * {@link TaskStatus } * */ public void setStatus(TaskStatus value) { getMetadata().removeUnknown("status"); if (m_validationSession!= null) { m_validationSession.set(this, "status", value, status); } this.status = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "status", value, status); } }
/** * Sets the value of the taskId property. * * @param value * allowed object is * {@link Long } * */ public void setTaskId(Long value) { getMetadata().removeUnknown("taskId"); if (m_validationSession!= null) { m_validationSession.set(this, "taskId", value, taskId); } this.taskId = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "taskId", value, taskId); } }
/** * Sets the value of the created property. * * @param value * allowed object is * {@link String } * */ public void setCreated(Date value) { getMetadata().removeUnknown("created"); if (m_validationSession!= null) { m_validationSession.set(this, "created", value, created); } this.created = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "created", value, created); } }
/** * Sets the value of the handler property. * * @param value * allowed object is * {@link Boolean } * */ public void setHandler(Boolean value) { getMetadata().removeUnknown("handler"); if (m_validationSession!= null) { m_validationSession.set(this, "handler", value, handler); } this.handler = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "handler", value, handler); } }
/** * Sets the value of the processDefinitionName property. * * @param value * allowed object is * {@link String } * */ public void setProcessDefinitionName(String value) { getMetadata().removeUnknown("processDefinitionName"); if (m_validationSession!= null) { m_validationSession.set(this, "processDefinitionName", value, processDefinitionName); } this.processDefinitionName = value; if (m_validationSession!= null) { m_validationSession.invokeListeners(this, "processDefinitionName", value, processDefinitionName); } }