com.evolveum.midpoint.task.api.Task.getChannel()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(127)

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

Task.getChannel介绍

[英]Returns change channel URI.
[中]返回更改频道URI。

代码示例

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

public String getChannel() {
  return task != null ? task.getChannel() : null;
}

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

@Override
public String getChannel() {
  Task task = getCurrentTask();
  return task != null ? task.getChannel() : null;
}

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

public static <F extends ObjectType> String getChannel(LensContext<F> context, Task task) {
  if (context != null && context.getChannel() != null){
    return context.getChannel();
  } else if (task.getChannel() != null){
    return task.getChannel();
  }
  return null;
}

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

public ExpressionVariables getDefaultVariables(@Nullable DelegateExecution execution, Task wfTask, OperationResult result)
    throws SchemaException, ObjectNotFoundException {
  ExpressionVariables variables = getDefaultVariables(wfTask.getWorkflowContext(), wfTask.getChannel(), result);
  // Activiti process instance variables (use with care)
  if (execution != null) {
    execution.getVariables().forEach((key, value) -> variables.addVariableDefinition(new QName("_" + key), value));
  }
  return variables;
}

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

public String getChannel() {
  return getTask()==null?null:getTask().getChannel();
}

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

@NotNull
private ModelEvent createModelEvent(PrismObject<?> object, ModelContext<?> modelContext, Task task) {
  ModelEvent event = new ModelEvent(lightweightIdentifierGenerator, modelContext);
  setCommonEventProperties(object, task, modelContext, event);
  // TODO is this correct? it's not quite clear how we work with channel info in task / modelContext
  String channel = task.getChannel();
  if (channel == null) {
    channel = modelContext.getChannel();
  }
  event.setChannel(channel);
  return event;
}

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

private String evaluateAutoCompleteExpression(ApprovalStageDefinitionType stageDef, PcpChildWfTaskCreationInstruction instruction,
      WfStageComputeHelper stageComputeHelper, ModelInvocationContext ctx, OperationResult result)
      throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException, SecurityViolationException {
    ExpressionVariables variables = stageComputeHelper.getDefaultVariables(instruction.getWfContext(), ctx.taskFromModel.getChannel(), result);
    return stageComputeHelper.evaluateAutoCompleteExpression(stageDef, variables, ctx.taskFromModel, result);
  }
}

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

/**
 * Tries to match specified focus and shadow. Return true if it matches,
 * false otherwise.
 */
@Override
public <F extends FocusType> boolean matchUserCorrelationRule(PrismObject<ShadowType> shadow,
    PrismObject<F> focus, ResourceType resourceType,
    PrismObject<SystemConfigurationType> configuration, Task task, OperationResult result)
        throws ConfigurationException, SchemaException, ObjectNotFoundException,
        ExpressionEvaluationException, CommunicationException, SecurityViolationException {
  
  SynchronizationContext<F> synchronizationContext = loadSynchronizationContext(shadow, shadow, resourceType.asPrismObject(), task.getChannel(), configuration, task, result);
  Class<F> focusClass;
  // TODO is this correct? The problem is that synchronizationPolicy can
  // be null...
  if (synchronizationContext.hasApplicablePolicy()) {
    focusClass = synchronizationContext.getFocusClass();
  } else {
    //noinspection unchecked
    focusClass = (Class<F>) focus.asObjectable().getClass();
  }
  return correlationConfirmationEvaluator.matchFocusByCorrelationRule(synchronizationContext, focus);
}

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

protected void fillInEvent(AccessCertificationCampaignType campaign, Task task, AccessCertificationEvent event) {
  event.setRequestee(new SimpleObjectRefImpl(notificationsUtil, campaign.getOwnerRef()));
  if (task != null) {
    event.setRequester(new SimpleObjectRefImpl(notificationsUtil, task.getOwner()));
    event.setChannel(task.getChannel());
  }
}

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

/**
 * Creates a root job, based on provided job start instruction.
 * Puts a reference to the workflow root task to the model task.
 *
 * @param rootInstruction instruction to use
 * @param taskFromModel (potential) parent task
 * @param wfConfigurationType
 * @param result
 * @return reference to a newly created job
 * @throws SchemaException
 * @throws ObjectNotFoundException
 */
public WfTask submitRootTask(WfTaskCreationInstruction rootInstruction, Task taskFromModel, WfConfigurationType wfConfigurationType,
    OperationResult result)
    throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException {
  WfTask rootWfTask = wfTaskController.submitWfTask(rootInstruction, determineParentTaskForRoot(taskFromModel), wfConfigurationType, taskFromModel.getChannel(), result);
  result.setBackgroundTaskOid(rootWfTask.getTask().getOid());
  wfTaskUtil.setRootTaskOidImmediate(taskFromModel, rootWfTask.getTask().getOid(), result);
  return rootWfTask;
}

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

boolean errorIfNotFound = !SchemaConstants.CHANNEL_GUI_INIT_URI.equals(task.getChannel());
SystemConfigurationType systemConfigurationType = NotificationFunctionsImpl
    .getSystemConfiguration(cacheRepositoryService, errorIfNotFound, result);

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

private ResourceOperationDescription createSuccessOperationDescription(ProvisioningContext ctx,
    PrismObject<ShadowType> shadowType, ObjectDelta delta, OperationResult parentResult)
        throws ObjectNotFoundException, SchemaException, CommunicationException,
        ConfigurationException, ExpressionEvaluationException {
  ResourceOperationDescription operationDescription = new ResourceOperationDescription();
  operationDescription.setCurrentShadow(shadowType);
  operationDescription.setResource(ctx.getResource().asPrismObject());
  if (ctx.getTask() != null) {
    operationDescription.setSourceChannel(ctx.getTask().getChannel());
  }
  operationDescription.setObjectDelta(delta);
  operationDescription.setResult(parentResult);
  return operationDescription;
}

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

private void createAndProcessEvent(Task task, TaskRunResult runResult, EventOperationType operationType) {
  TaskEvent event = new TaskEvent(lightweightIdentifierGenerator, task, runResult, operationType, task.getChannel());
  if (task.getOwner() != null) {
    event.setRequester(new SimpleObjectRefImpl(notificationsUtil, task.getOwner().asObjectable()));
    event.setRequestee(new SimpleObjectRefImpl(notificationsUtil, task.getOwner().asObjectable()));
  } else {
    LOGGER.debug("No owner for task " + task + ", therefore no requester and requestee will be set for event " + event.getId());
  }
  Task opTask = taskManager.createTaskInstance(OPERATION_PROCESS_EVENT);
  notificationManager.processEvent(event, opTask, opTask.getResult());
}

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

private ResourceObjectEvent createRequest(OperationStatus status,
                     ResourceOperationDescription operationDescription,
                     Task task,
                     OperationResult result) {
  ResourceObjectEvent event = new ResourceObjectEvent(lightweightIdentifierGenerator);
  event.setAccountOperationDescription(operationDescription);
  event.setOperationStatus(status);
  event.setChangeType(operationDescription.getObjectDelta().getChangeType());       // fortunately there's 1:1 mapping
  String accountOid = operationDescription.getObjectDelta().getOid();
  PrismObject<UserType> user = findRequestee(accountOid, task, result, operationDescription.getObjectDelta().isDelete());
  if (user != null) {
    event.setRequestee(new SimpleObjectRefImpl(notificationsUtil, user.asObjectable()));
  }   // otherwise, appropriate messages were already logged
  if (task != null && task.getOwner() != null) {
    event.setRequester(new SimpleObjectRefImpl(notificationsUtil, task.getOwner()));
  } else {
    LOGGER.warn("No owner for task {}, therefore no requester will be set for event {}", task, event.getId());
  }
  if (task != null && task.getChannel() != null) {
    event.setChannel(task.getChannel());
  } else if (operationDescription.getSourceChannel() != null) {
    event.setChannel(operationDescription.getSourceChannel());
  }
  return event;
}

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

if (task.getChannel() == null) {
  task.setChannel(context.getChannel());

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

syncCtx = synchronizationService.loadSynchronizationContext(fullShadow, fullShadow, resource, task.getChannel(), systemObjectCache.getSystemConfiguration(result), task, result);
} catch (SchemaException | ObjectNotFoundException | ExpressionEvaluationException | RuntimeException | CommunicationException | ConfigurationException | SecurityViolationException e) {
  checkResult.recordError(ShadowStatistics.CANNOT_APPLY_FIX, new SystemException("Couldn't prepare fix for missing intent, because the synchronization policy couldn't be determined", e));

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

.createSynchronizationSituationAndDescriptionDelta(currentShadow, newSituation, task.getChannel(),
    projectionCtx.hasFullShadow(), now, prismContext);

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

ApprovalStageDefinitionType stageDef = ActivitiUtil.getAndVerifyCurrentStage(execution, wfTask, false, prismContext);
int stageNumber = stageDef.getNumber();
opTask.setChannel(wfTask.getChannel());         // TODO !!!!!!!!!!

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

runResult.setOperationResult(opResult);
if (task.getChannel() == null) {
  task.setChannel(SchemaConstants.CHANNEL_REMEDIATION_URI);

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

resource.asPrismObject(), getCurrentTask().getChannel(), getCurrentTask(), getCurrentResult());

相关文章

微信公众号

最新文章

更多