gpt4 book ai didi

com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType类的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 23:59:05 31 4
gpt4 key购买 nike

本文整理了Java中com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType类的一些代码示例,展示了WorkItemType类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkItemType类的具体详情如下:
包路径:com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType
类名称:WorkItemType

WorkItemType介绍

暂无

代码示例

代码示例来源:origin: Evolveum/midpoint

/**
 * Create an instance of {@link WorkItemType }
 * 
 */
public WorkItemType createWorkItemType() {
  return new WorkItemType();
}

代码示例来源:origin: Evolveum/midpoint

public WorkItemType assigneeRef(ObjectReferenceType value) {
  getAssigneeRef().add(value);
  return this;
}

代码示例来源:origin: Evolveum/midpoint

public WorkItemType additionalInformation(InformationType value) {
  getAdditionalInformation().add(value);
  return this;
}

代码示例来源:origin: Evolveum/midpoint

@Override
protected WorkItemType createItem(PrismContainerValue value) {
  WorkItemType workItem = new WorkItemType();
  workItem.setupContainerValue(value);
  return workItem;
}

代码示例来源:origin: Evolveum/midpoint

public WorkItemType clone() {
  WorkItemType object = new WorkItemType();
  PrismContainerValue value = asPrismContainerValue().clone();
  object.setupContainerValue(value);
  return object;
}

代码示例来源:origin: Evolveum/midpoint

public List<InformationType> createAdditionalInformationList() {
  PrismForJAXBUtil.createProperty(asPrismContainerValue(), F_ADDITIONAL_INFORMATION);
  return getAdditionalInformation();
}

代码示例来源:origin: Evolveum/midpoint

WorkItemType wi = new WorkItemType(prismContext);
final Map<String, Object> variables = task.getVariables();
wi.setExternalId(task.getId());
wi.setName(task.getName());
wi.setCreateTimestamp(XmlTypeConverter.createXMLGregorianCalendar(task.getCreateTime()));
wi.setDeadline(XmlTypeConverter.createXMLGregorianCalendar(task.getDueDate()));
wi.getAssigneeRef().addAll(getMidpointAssignees(task));
String originalAssigneeString = ActivitiUtil.getVariable(variables,
    CommonProcessVariableNames.VARIABLE_ORIGINAL_ASSIGNEE, String.class, prismContext);
if (originalAssigneeString != null) {
  wi.setOriginalAssigneeRef(MiscDataUtil.stringToRef(originalAssigneeString));
  miscDataUtil.resolveAndStoreObjectReferences(wi.getAssigneeRef(), result);
  miscDataUtil.resolveAndStoreObjectReference(wi.getOriginalAssigneeRef(), result);
task.getCandidateUsers().forEach(s -> wi.getCandidateRef().add(createObjectRef(s, USER)));
task.getCandidateGroups().forEach(s -> wi.getCandidateRef().add(MiscDataUtil.stringToRef(s)));
if (resolveCandidates) {
  miscDataUtil.resolveAndStoreObjectReferences(wi.getCandidateRef(), result);
wi.setOutput(pmi.extractWorkItemResult(variables));
String completedBy = ActivitiUtil.getVariable(variables, CommonProcessVariableNames.VARIABLE_WORK_ITEM_COMPLETED_BY, String.class, prismContext);
if (completedBy != null) {
  wi.setPerformerRef(ObjectTypeUtil.createObjectRef(completedBy, ObjectTypes.USER));
wi.setStageNumber(pmi.getStageNumber(variables));

代码示例来源:origin: Evolveum/midpoint

@Test
public void test100CreateTask() throws Exception {
  final String TEST_NAME = "test100CreateTask";
  TestUtil.displayTestTitle(this, TEST_NAME);
  login(userAdministrator);
  Task task = createTask(TEST_NAME);
  OperationResult result = task.getResult();
  assignRole(userJackOid, roleE1Oid, task, result);                // should start approval process
  assertNotAssignedRole(userJackOid, roleE1Oid, task, result);
  WorkItemType workItem = getWorkItem(task, result);
  workItemId = workItem.getExternalId();
  approvalTaskOid = WfContextUtil.getTask(workItem).getOid();
  PrismObject<TaskType> wfTask = getTask(approvalTaskOid);
  display("work item", workItem);
  display("workflow task", wfTask);
  // 5 days: notification
  // D-2 days: escalate
  // D-0 days: approve
  assertEquals("Wrong # of triggers", 3, wfTask.asObjectable().getTrigger().size());
  PrismAsserts.assertReferenceValues(ref(workItem.getAssigneeRef()), userLead1Oid);
  PrismAsserts.assertReferenceValue(ref(workItem.getOriginalAssigneeRef()), userLead1Oid);
}

代码示例来源:origin: Evolveum/midpoint

private void appendAssigneeInformation(StringBuilder sb, WorkItemEvent event, OperationResult result) {
  WorkItemType workItem = event.getWorkItem();
  ObjectReferenceType originalAssignee = workItem.getOriginalAssigneeRef();
  List<ObjectReferenceType> currentAssignees = workItem.getAssigneeRef();
  boolean atLeastOne = false;
  if (currentAssignees.size() != 1 || !java.util.Objects.equals(originalAssignee.getOid(), currentAssignees.get(0).getOid())) {
    UserType originalAssigneeObject = (UserType) functions.getObjectType(originalAssignee, true, result);
    sb.append("Originally allocated to: ").append(
        textFormatter.formatUserName(originalAssigneeObject, originalAssignee.getOid())).append("\n");
    atLeastOne = true;
  }
  if (!workItem.getAssigneeRef().isEmpty()) {
    sb.append("Allocated to");
    if (event.getOperationKind() == WorkItemOperationKindType.DELEGATE) {
      sb.append(event.isAdd() ? " (after delegation)" : " (before delegation)");
    } else if (event.getOperationKind() == WorkItemOperationKindType.ESCALATE) {
      sb.append(event.isAdd() ? " (after escalation)" : " (before escalation)");
    }
    sb.append(": ");
    sb.append(workItem.getAssigneeRef().stream()
        .map(ref -> textFormatter.formatUserName(ref, result))
        .collect(Collectors.joining(", ")));
    sb.append("\n");
    atLeastOne = true;
  }
  if (atLeastOne) {
    sb.append("\n");
  }
}

代码示例来源:origin: Evolveum/midpoint

public AuditEventRecord prepareWorkItemAuditReportCommon(WorkItemType workItem, WfTask wfTask, AuditEventStage stage,
    OperationResult result) throws WorkflowException {
  AuditEventRecord record = new AuditEventRecord();
  record.setEventType(AuditEventType.WORK_ITEM);
  record.setEventStage(stage);
  ObjectReferenceType objectRef = resolveIfNeeded(WfContextUtil.getObjectRef(workItem), result);
  record.setTarget(objectRef.asReferenceValue());
  record.setOutcome(OperationResultStatus.SUCCESS);
  record.setParameter(wfTask.getCompleteStageInfo());
  record.addReferenceValueIgnoreNull(WorkflowConstants.AUDIT_OBJECT, objectRef);
  record.addReferenceValueIgnoreNull(WorkflowConstants.AUDIT_TARGET, resolveIfNeeded(WfContextUtil.getTargetRef(workItem), result));
  record.addReferenceValueIgnoreNull(WorkflowConstants.AUDIT_ORIGINAL_ASSIGNEE, resolveIfNeeded(workItem.getOriginalAssigneeRef(), result));
  record.addReferenceValues(WorkflowConstants.AUDIT_CURRENT_ASSIGNEE, resolveIfNeeded(workItem.getAssigneeRef(), result));
  record.addPropertyValueIgnoreNull(WorkflowConstants.AUDIT_STAGE_NUMBER, workItem.getStageNumber());
  record.addPropertyValueIgnoreNull(WorkflowConstants.AUDIT_STAGE_COUNT, WfContextUtil.getStageCount(workItem));
  record.addPropertyValueIgnoreNull(WorkflowConstants.AUDIT_STAGE_NAME, WfContextUtil.getStageName(workItem));
  record.addPropertyValueIgnoreNull(WorkflowConstants.AUDIT_STAGE_DISPLAY_NAME, WfContextUtil.getStageDisplayName(workItem));
  record.addPropertyValueIgnoreNull(WorkflowConstants.AUDIT_ESCALATION_LEVEL_NUMBER, WfContextUtil.getEscalationLevelNumber(workItem));
  record.addPropertyValueIgnoreNull(WorkflowConstants.AUDIT_ESCALATION_LEVEL_NAME, WfContextUtil.getEscalationLevelName(workItem));
  record.addPropertyValueIgnoreNull(WorkflowConstants.AUDIT_ESCALATION_LEVEL_DISPLAY_NAME, WfContextUtil.getEscalationLevelDisplayName(workItem));
  record.addPropertyValue(WorkflowConstants.AUDIT_WORK_ITEM_ID, workItem.getExternalId());
  record.addPropertyValue(WorkflowConstants.AUDIT_PROCESS_INSTANCE_ID, WfContextUtil.getProcessInstanceId(workItem));
  return record;
}

代码示例来源:origin: Evolveum/midpoint

public boolean isAuthorizedToClaim(WorkItemType workItem) {
  return isAuthorizedToClaim(workItem.getExternalId());
}

代码示例来源:origin: Evolveum/midpoint

public boolean isAuthorized(WorkItemType workItem, RequestedOperation operation, Task task, OperationResult result) throws ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException, SecurityViolationException {
  MidPointPrincipal principal;
  try {
    principal = securityContextManager.getPrincipal();
  } catch (SecurityViolationException e) {
    return false;
  }
  if (principal.getOid() == null) {
    return false;
  }
  try {
    if (securityEnforcer.isAuthorized(operation.actionAll.getUrl(), null, AuthorizationParameters.EMPTY, null, task, result)) {
      return true;
    }
    if (operation.actionOwn != null && !securityEnforcer.isAuthorized(operation.actionOwn.getUrl(), null, AuthorizationParameters.EMPTY, null, task, result)) {
      return false;
    }
  } catch (SchemaException e) {
    throw new SystemException(e.getMessage(), e);
  }
  for (ObjectReferenceType assignee : workItem.getAssigneeRef()) {
    if (isEqualOrDeputyOf(principal, assignee.getOid(), relationRegistry)) {
      return true;
    }
  }
  return isAmongCandidates(principal, workItem.getExternalId());
}

代码示例来源:origin: Evolveum/midpoint

ObjectReferenceType userRef = user != null ? user.toObjectReference() : workItem.getPerformerRef();	// partial fallback
    WorkItemResultType workItemOutput = new WorkItemResultType();
    workItemOutput.setOutcome(completeAction.getOutcome() != null ? completeAction.getOutcome() : SchemaConstants.MODEL_APPROVAL_OUTCOME_REJECT);
    workItem.setOutput(workItemOutput);
      new WorkItemAllocationChangeOperationInfo(operationKind, assigneesAndDeputies, null);
  WorkItemOperationSourceInfo sourceInfo = new WorkItemOperationSourceInfo(userRef, cause, null);
  if (workItem.getAssigneeRef().isEmpty()) {
    notifyWorkItemDeleted(null, workItem, operationInfo, sourceInfo, wfTask, result);
  } else {
AbstractWorkItemOutputType output = workItem.getOutput();
if (genuinelyCompleted || output != null) {
  WorkItemCompletionEventType event = new WorkItemCompletionEventType();

代码示例来源:origin: Evolveum/midpoint

List<ObjectReferenceType> assigneesBefore = CloneUtil.cloneCollectionMembers(workItem.getAssigneeRef());
List<ObjectReferenceType> assigneesAndDeputiesBefore = wfTaskController.getAssigneesAndDeputies(workItem, opTask, result);
    XmlTypeConverter.toDate(workItem.getCreateTimestamp()),
    deadline, wfTask, level.getTimedActions(), result);

代码示例来源:origin: Evolveum/midpoint

private String getCompareKey(WorkItemType workItem) {
  return workItem.getOriginalAssigneeRef().getOid();
}

代码示例来源:origin: Evolveum/midpoint

public AbstractWorkItemOutputType getOutput() {
  return workItem.getOutput();
}

代码示例来源:origin: Evolveum/midpoint

public WorkItemType createTimestamp(XMLGregorianCalendar value) {
  setCreateTimestamp(value);
  return this;
}

代码示例来源:origin: Evolveum/midpoint

public WorkItemType deadline(XMLGregorianCalendar value) {
  setDeadline(value);
  return this;
}

代码示例来源:origin: Evolveum/midpoint

public WorkItemType candidateRef(ObjectReferenceType value) {
  getCandidateRef().add(value);
  return this;
}

代码示例来源:origin: Evolveum/midpoint

display("items2", items2);
assertEquals("Wrong # of work items found using 'create timestamp' query", 1, items2.size());
created = items2.get(0).getCreateTimestamp();

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com