gpt4 book ai didi

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

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

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

WorkItemType.getExternalId介绍

暂无

代码示例

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

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

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

private void executeCompleteAction(WorkItemType workItem, CompleteWorkItemActionType completeAction,
    OperationResult result) throws SchemaException, SecurityViolationException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
  WorkItemOutcomeType outcome = completeAction.getOutcome() != null ? ApprovalUtils.fromUri(completeAction.getOutcome()) : WorkItemOutcomeType.REJECT;
  workItemManager.completeWorkItem(workItem.getExternalId(), ApprovalUtils.toUri(outcome),
      null, null, WfContextUtil.createCause(completeAction), result);
}

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

private void executeDelegateAction(WorkItemType workItem, DelegateWorkItemActionType delegateAction, boolean escalate,
    Task wfTask, Task triggerScannerTask, OperationResult result)
    throws SecurityViolationException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException {
  WorkItemEscalationLevelType escLevel = escalate ? WfContextUtil.createEscalationLevelInformation(delegateAction) : null;
  List<ObjectReferenceType> delegates = computeDelegateTo(delegateAction, workItem, wfTask, triggerScannerTask, result);
  workItemManager.delegateWorkItem(workItem.getExternalId(), delegates,
      delegateAction.getDelegationMethod(), escLevel,
      delegateAction.getDuration(), WfContextUtil.createCause(delegateAction), result);
}

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

public void approveAllWorkItems(Task task, OperationResult result) throws Exception {
  List<WorkItemType> workItems = getWorkItems(task, result);
  display("work items", workItems);
  display("approving work items");
  for (WorkItemType workItem : workItems) {
    workflowManager.completeWorkItem(workItem.getExternalId(), true, null, null, null, result);
  }
}

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

@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, roleNoApproversOid, task, result);                // should start approval process
  assertNotAssignedRole(userJackOid, roleNoApproversOid, 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);
  // TODO check events
}

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

.taskId(workItem.getExternalId())
    .singleResult();
System.out.println("Activiti task: " + activitiTask);

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

@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 test100CreateTask() throws Exception {
  final String TEST_NAME = "test100CreateTask";
  TestUtil.displayTestTitle(this, TEST_NAME);
  login(userAdministrator);
  userLead1 = getUser(userLead1Oid);
  userLead3 = getUser(userLead3Oid);
  Task task = createTask(TEST_NAME);
  OperationResult result = task.getResult();
  assignRole(userJackOid, roleRole1aOid, task, result);                // should start approval process
  assertNotAssignedRole(userJackOid, roleRole1aOid, task, result);
  WorkItemType workItem = getWorkItem(task, result);
  workItemId = workItem.getExternalId();
  taskOid = WfContextUtil.getTask(workItem).getOid();
  display("work item", workItem);
  display("task", getObjectViaRepo(TaskType.class, taskOid));
  PrismAsserts.assertReferenceValues(ref(workItem.getAssigneeRef()), userLead1Oid);
}

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

assertEquals("wrong # of attached policy rules", 2, info.getPolicyRules().getEntry().size());
workflowService.completeWorkItem(workItem.getExternalId(), true, null, null, result);
assertEquals("wrong # of work items", 1, wfc.getWorkItem().size());
workItem = wfc.getWorkItem().get(0);
workflowService.completeWorkItem(workItem.getExternalId(), true, null, null, result);

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

workflowService.completeWorkItem(workItem.getExternalId(), true, null, null, result);
waitForTaskFinish(rootTask.getOid(), false);

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

workflowManager.completeWorkItem(workItem.getExternalId(), true, "OK", null, null, result);

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

workflowManager.completeWorkItem(workItem.getExternalId(), true, "OK", null, null, result);

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

System.out.println("Completing work item " + workItem.getExternalId() + " using " + approvalInstruction);
workflowManager.completeWorkItem(workItem.getExternalId(), approvalInstruction.approval, approvalInstruction.comment,
    null, null, result);
if (approvalInstruction.afterApproval != null) {

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

@Test
public void test110RequestPrunedRole() throws Exception {
  final String TEST_NAME = "test110RequestPrunedRole";
  TestUtil.displayTestTitle(this, TEST_NAME);
  login(userAdministrator);
  Task task = createTask(TEST_NAME);
  OperationResult result = task.getResult();
  // GIVEN
  assignRole(RoleType.class, roleRole2Oid, metarolePruneTest2xRolesOid, task, result);
  assignRole(RoleType.class, roleRole2aOid, metarolePruneTest2xRolesOid, task, result);
  assignRole(RoleType.class, roleRole2bOid, metarolePruneTest2xRolesOid, task, result);
  assignRole(RoleType.class, roleRole2Oid, metaroleApproveUnassign, task, result);
  //display("lead2", getUser(userLead2Oid));
  // WHEN
  assignRole(userJackOid, roleRole2aOid, task, result);
  // THEN
  result.computeStatus();
  TestUtil.assertInProgress("Operation NOT in progress", result);
  assertNotAssignedRole(userJackOid, roleRole2aOid, task, result);
  // complete the work item related to assigning role-2a
  WorkItemType workItem = getWorkItem(task, result);
  display("Work item", workItem);
  workflowManager.completeWorkItem(workItem.getExternalId(), true, null, null, null, result);
  TaskType wfTask = getTask(WfContextUtil.getTask(workItem).getOid()).asObjectable();
  Task parent = taskManager.createTaskInstance(wfTask.asPrismObject(), result).getParentTask(result);
  waitForTaskFinish(parent.getOid(), false);
  assertNotAssignedRole(userJackOid, roleRole2Oid, task, result);            // should be pruned without approval
}

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

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