gpt4 book ai didi

com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType.getOriginalAssigneeRef()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 00:45:05 28 4
gpt4 key购买 nike

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

WorkItemType.getOriginalAssigneeRef介绍

暂无

代码示例

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

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

代码示例来源: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 boolean matches(WorkItemType actualWorkItem) {
  if (!assigneeOid.equals(actualWorkItem.getOriginalAssigneeRef().getOid())) {
    return false;
  }
  if (targetOid != null && !targetOid.equals(WfContextUtil.getTargetRef(actualWorkItem).getOid())) {
    return false;
  }
  TaskType actualTask = WfContextUtil.getTask(actualWorkItem);
  return task.processName.equals(actualTask.getWorkflowContext().getProcessInstanceName());
}

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

@Test
public void test120DelegateToUser2() throws Exception {
  final String TEST_NAME = "test120DelegateToUser2";
  TestUtil.displayTestTitle(this, TEST_NAME);
  login(userLead1);
  Task task = createTask(TEST_NAME);
  OperationResult result = task.getResult();
  workflowService.delegateWorkItem(workItemId, Collections.singletonList(ort(userLead2Oid)), ADD_ASSIGNEES, result);
  result.computeStatus();
  assertSuccess(result);
  WorkItemType workItem = getWorkItem(task, result);
  display("work item", workItem);
  PrismObject<TaskType> wfTask = getObjectViaRepo(TaskType.class, taskOid);
  display("task", wfTask);
  PrismAsserts.assertReferenceValues(ref(workItem.getAssigneeRef()), userLead1Oid, userLead2Oid);
  assertRefEquals("Wrong originalAssigneeRef", ort(userLead1Oid), workItem.getOriginalAssigneeRef());
  org.activiti.engine.task.Task activitiTask = activitiEngine.getTaskService().createTaskQuery()
      .taskId(workItem.getExternalId())
      .singleResult();
  System.out.println("Activiti task: " + activitiTask);
  assertEquals("Wrong activiti assignee", "UserType:"+userLead1Oid, activitiTask.getAssignee());
  List<String> assignees = getAssignees(activitiTask);
  assertEquals("Wrong midpoint-assignee values", new HashSet<>(Arrays.asList("UserType:" + userLead1Oid, "UserType:" + userLead2Oid)),
      new HashSet<>(assignees));
  List<WorkItemDelegationEventType> events = WfContextUtil.getWorkItemEvents(wfTask.asObjectable().getWorkflowContext(), workItemId, WorkItemDelegationEventType.class);
  assertEquals("Wrong # of delegation events", 1, events.size());
  // TODO check content
}

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

miscDataUtil.resolveAndStoreObjectReference(wi.getOriginalAssigneeRef(), result);

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

assertRefEquals("Wrong originalAssigneeRef", ort(userLead1Oid), workItem.getOriginalAssigneeRef());

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

@Test
public void test130DelegateToUser3ByReplace() throws Exception {
  final String TEST_NAME = "test130DelegateToUser3ByReplace";
  TestUtil.displayTestTitle(this, TEST_NAME);
  login(userLead1);
  Task task = createTask(TEST_NAME);
  OperationResult result = task.getResult();
  workflowService.delegateWorkItem(workItemId, Collections.singletonList(ort(userLead3Oid)), REPLACE_ASSIGNEES, result);
  result.computeStatus();
  assertSuccess(result);
  WorkItemType workItem = getWorkItem(task, result);
  display("work item", workItem);
  PrismObject<TaskType> wfTask = getObjectViaRepo(TaskType.class, taskOid);
  display("task", wfTask);
  PrismAsserts.assertReferenceValues(ref(workItem.getAssigneeRef()), userLead3Oid);
  assertRefEquals("Wrong originalAssigneeRef", ort(userLead1Oid), workItem.getOriginalAssigneeRef());
  org.activiti.engine.task.Task activitiTask = activitiEngine.getTaskService().createTaskQuery()
      .taskId(workItem.getExternalId())
      .singleResult();
  System.out.println("Activiti task: " + activitiTask);
  assertEquals("Wrong activiti assignee", "UserType:"+userLead3Oid, activitiTask.getAssignee());
  List<String> assignees = getAssignees(activitiTask);
  assertEquals("Wrong midpoint-assignee values", Collections.singleton("UserType:" + userLead3Oid),
      new HashSet<>(assignees));
  List<WorkItemDelegationEventType> events = WfContextUtil.getWorkItemEvents(wfTask.asObjectable().getWorkflowContext(), workItemId, WorkItemDelegationEventType.class);
  assertEquals("Wrong # of delegation events", 2, events.size());
  // TODO check content
}

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

.assertRef("assignee reference", workItem.getOriginalAssigneeRef(), expectedWorkItems.get(i).assigneeOid, false, true);

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

@Test
public void test110Notify() throws Exception {
  final String TEST_NAME = "test110Notify";
  TestUtil.displayTestTitle(this, TEST_NAME);
  login(userAdministrator);
  Task task = createTask(TEST_NAME);
  OperationResult result = task.getResult();
  clock.overrideDuration("P6D");			// at P5D there's a notify action
  waitForTaskNextRun(TASK_TRIGGER_SCANNER_OID, true, 20000, true);
  // TODO assert notifications
  WorkItemType workItem = getWorkItem(task, result);
  display("work item", workItem);
  String wfTaskOid = WfContextUtil.getTask(workItem).getOid();
  PrismObject<TaskType> wfTask = getTask(wfTaskOid);
  display("task", wfTask);
  assertEquals("Wrong # of triggers", 2, wfTask.asObjectable().getTrigger().size());
  PrismAsserts.assertReferenceValues(ref(workItem.getAssigneeRef()), userLead1Oid);
  PrismAsserts.assertReferenceValue(ref(workItem.getOriginalAssigneeRef()), userLead1Oid);
}

代码示例来源: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

@Test
public void test120Escalate() throws Exception {
  final String TEST_NAME = "test120Escalate";
  TestUtil.displayTestTitle(this, TEST_NAME);
  login(userAdministrator);
  Task task = createTask(TEST_NAME);
  OperationResult result = task.getResult();
  clock.resetOverride();
  clock.overrideDuration("P13D");		// at -P2D (i.e. P12D) there is a delegate action
  waitForTaskNextRun(TASK_TRIGGER_SCANNER_OID, true, 20000, true);
  WorkItemType workItem = getWorkItem(task, result);
  display("work item", workItem);
  PrismObject<TaskType> wfTask = getTask(WfContextUtil.getTask(workItem).getOid());
  display("task", wfTask);
  assertEquals("Wrong # of triggers", 1, wfTask.asObjectable().getTrigger().size());
  PrismAsserts.assertReferenceValues(ref(workItem.getAssigneeRef()), userLead1Oid, userLead2Oid);
  PrismAsserts.assertReferenceValue(ref(workItem.getOriginalAssigneeRef()), userLead1Oid);
  assertEquals("Wrong escalation level number", 1, WfContextUtil.getEscalationLevelNumber(workItem));
}

代码示例来源: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

WfTestUtil.assertRef("object reference", WfContextUtil.getObjectRef(workItem), USER_JACK_OID, true, true);
WfTestUtil.assertRef("target reference", WfContextUtil.getTargetRef(workItem), ROLE_R1_OID, true, true);
WfTestUtil.assertRef("assignee reference", workItem.getOriginalAssigneeRef(), R1BOSS_OID, false, true);     // name is not known, as it is not stored in activiti (only OID is)

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