/** * Creates a new {@code WorkItemEventCauseInformationType} instance by deeply copying a given {@code WorkItemEventCauseInformationType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public WorkItemEventCauseInformationType(final WorkItemEventCauseInformationType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'WorkItemEventCauseInformationType' from 'null'."); } // CEnumLeafInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemEventCauseTypeType this.type = ((o.type == null)?null:o.getType()); // CBuiltinLeafInfo: java.lang.String this.name = ((o.name == null)?null:o.getName()); // CBuiltinLeafInfo: java.lang.String this.displayName = ((o.displayName == null)?null:o.getDisplayName()); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public WorkItemEventCauseInformationType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final WorkItemEventCauseInformationType clone = ((WorkItemEventCauseInformationType) super.clone()); // CEnumLeafInfo: com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemEventCauseTypeType clone.type = ((this.type == null)?null:this.getType()); // CBuiltinLeafInfo: java.lang.String clone.name = ((this.name == null)?null:this.getName()); // CBuiltinLeafInfo: java.lang.String clone.displayName = ((this.displayName == null)?null:this.getDisplayName()); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
private void appendResultAndOriginInformation(StringBuilder sb, WorkItemEvent event, OperationResult result) { boolean atLeastOne = appendResultInformation(sb, event, false); WorkItemEventCauseInformationType cause = event.getCause(); if (cause != null && cause.getType() == WorkItemEventCauseTypeType.TIMED_ACTION) { sb.append("Reason: "); if (cause.getDisplayName() != null) { sb.append(cause.getDisplayName()).append(" (timed action)"); } else if (cause.getName() != null) { sb.append(cause.getName()).append(" (timed action)"); } else { sb.append("Timed action"); } sb.append("\n"); atLeastOne = true; } else { SimpleObjectRef initiator = event.getInitiator(); if (initiator != null && !isCancelled(event)) { UserType initiatorFull = (UserType) functions.getObjectType(initiator, true, result); sb.append("Carried out by: ").append(textFormatter.formatUserName(initiatorFull, initiator.getOid())).append("\n"); atLeastOne = true; } } if (atLeastOne) { sb.append("\n"); } }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { WorkItemEventCauseTypeType theType; theType = this.getType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); } { String theName; theName = this.getName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); } { String theDisplayName; theDisplayName = this.getDisplayName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "displayName", theDisplayName), currentHashCode, theDisplayName); } return currentHashCode; }
assertEquals("Wrong outcome in "+c, WorkItemOutcomeType.REJECT, ApprovalUtils.fromUri(c.getOutput().getOutcome())); assertNotNull("No cause in "+c, c.getCause()); assertEquals("Wrong cause type in "+c, WorkItemEventCauseTypeType.TIMED_ACTION, c.getCause().getType()); assertEquals("Wrong cause name in "+c, "auto-reject", c.getCause().getName()); assertEquals("Wrong cause display name in "+c, "Automatic rejection at deadline", c.getCause().getDisplayName());
causeInformation == null || causeInformation.getType() == WorkItemEventCauseTypeType.USER_ACTION ? ObjectTypeUtil.createObjectRef(principal.getUser(), prismContext) : null;