public WfConfigurationType clone() { WfConfigurationType object = new WfConfigurationType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
public PerformerCommentsFormattingType beginApproverCommentsFormatting() { PerformerCommentsFormattingType value = new PerformerCommentsFormattingType(); approverCommentsFormatting(value); return value; }
public WfExecutionTasksConfigurationType beginExecutionTasks() { WfExecutionTasksConfigurationType value = new WfExecutionTasksConfigurationType(); executionTasks(value); return value; }
/** * Create an instance of {@link WfConfigurationType } * */ public WfConfigurationType createWfConfigurationType() { return new WfConfigurationType(); }
@Override public boolean equals(Object object) { if (!(object instanceof WfConfigurationType)) { return false; } WfConfigurationType other = ((WfConfigurationType) object); return asPrismContainerValue().equivalent(other.asPrismContainerValue()); }
@Override public HookOperationMode processModelInvocation(@NotNull ModelContext context, WfConfigurationType wfConfigurationType, @NotNull Task taskFromModel, @NotNull OperationResult result) throws SchemaException { if (wfConfigurationType != null && wfConfigurationType.getGeneralChangeProcessor() != null && Boolean.FALSE.equals(wfConfigurationType.getGeneralChangeProcessor().isEnabled())) { LOGGER.trace("{} is disabled", getBeanName()); return null; } if (wfConfigurationType == null || wfConfigurationType.getGeneralChangeProcessor() == null || wfConfigurationType.getGeneralChangeProcessor().getScenario().isEmpty()) { LOGGER.trace("No scenarios for {}", getBeanName()); return null; } GeneralChangeProcessorConfigurationType processorConfigurationType = wfConfigurationType.getGeneralChangeProcessor(); for (GeneralChangeProcessorScenarioType scenarioType : processorConfigurationType.getScenario()) { GcpScenarioBean scenarioBean = findScenarioBean(scenarioType.getBeanName()); if (Boolean.FALSE.equals(scenarioType.isEnabled())) { LOGGER.trace("scenario {} is disabled, skipping", scenarioType.getName()); } else if (!gcpExpressionHelper.evaluateActivationCondition(scenarioType, context, taskFromModel, result)) { LOGGER.trace("activationCondition was evaluated to FALSE for scenario named {}", scenarioType.getName()); } else if (!scenarioBean.determineActivation(scenarioType, context, taskFromModel, result)) { LOGGER.trace("scenarioBean decided to skip scenario named {}", scenarioType.getName()); } else { LOGGER.trace("Applying scenario {} (process name {})", scenarioType.getName(), scenarioType.getProcessName()); return applyScenario(scenarioType, scenarioBean, context, taskFromModel, wfConfigurationType, result); } } LOGGER.trace("No scenario found to be applicable, exiting the change processor."); return null; }
if (simple) { ScheduleType schedule = new ScheduleType(); Integer processCheckInterval = wfConfigurationType != null ? wfConfigurationType.getProcessCheckInterval() : null; schedule.setInterval(processCheckInterval != null ? processCheckInterval : DEFAULT_PROCESS_CHECK_INTERVAL); schedule.setEarliestStartTime(MiscUtil.asXMLGregorianCalendar(new Date(System.currentTimeMillis() + WfTaskController.TASK_START_DELAY))); WfExecutionTasksConfigurationType tasksConfig = wfConfigurationType != null ? wfConfigurationType.getExecutionTasks() : null; if (executeModelOperationHandler && tasksConfig != null) { TaskType taskBean = task.getTaskPrismObject().asObjectable();
public GeneralChangeProcessorConfigurationType beginGeneralChangeProcessor() { GeneralChangeProcessorConfigurationType value = new GeneralChangeProcessorConfigurationType(); generalChangeProcessor(value); return value; }
public Collection<String> getApproverCommentsFromTaskTree(Task task, OperationResult result) throws SchemaException { Task opTask = taskManager.createTaskInstance(); Collection<String> rv = new HashSet<>(); PrismObject<SystemConfigurationType> systemConfiguration = systemObjectCache.getSystemConfiguration(result); PerformerCommentsFormattingType formatting = systemConfiguration != null && systemConfiguration.asObjectable().getWorkflowConfiguration() != null ? systemConfiguration.asObjectable().getWorkflowConfiguration().getApproverCommentsFormatting() : null; PerformerCommentsFormatter formatter = workflowManager.createPerformerCommentsFormatter(formatting); List<Task> tasks = task.listSubtasksDeeply(result); tasks.add(task); for (Task aTask : tasks) { rv.addAll(getApproverComments(WfContextUtil.getWorkflowContext(aTask.getTaskPrismObject()), formatter, opTask, result)); } return rv; }
@Override protected void updateSystemConfiguration(SystemConfigurationType systemConfiguration) throws SchemaException, IOException { super.updateSystemConfiguration(systemConfiguration); systemConfiguration.getWorkflowConfiguration() .beginExecutionTasks() .beginSerialization() .retryAfter(XmlTypeConverter.createDuration(1000)); // makes tests run faster }
/** * Create an instance of {@link WfConfigurationType } * */ public WfConfigurationType createWfConfigurationType() { return new WfConfigurationType(); }
@XmlSchemaType(name = "string") @XmlElement(name = "useLegacyApproversSpecification") public LegacyApproversSpecificationUsageType getUseLegacyApproversSpecification() { return PrismForJAXBUtil.getPropertyValue(asPrismContainerValue(), F_USE_LEGACY_APPROVERS_SPECIFICATION, LegacyApproversSpecificationUsageType.class); }
protected void enableDisableScenarios(boolean... values) throws ObjectNotFoundException, SchemaException, com.evolveum.midpoint.util.exception.ExpressionEvaluationException, com.evolveum.midpoint.util.exception.CommunicationException, com.evolveum.midpoint.util.exception.ConfigurationException, com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException, com.evolveum.midpoint.util.exception.PolicyViolationException, com.evolveum.midpoint.util.exception.SecurityViolationException { OperationResult result = new OperationResult("execution"); Task task = taskManager.createTaskInstance("execution"); GeneralChangeProcessorConfigurationType gcpConfig = getSystemConfiguration().getWorkflowConfiguration().getGeneralChangeProcessor(); for (int i = 0; i < values.length; i++) { gcpConfig.getScenario().get(i).setEnabled(values[i]); } modifyObjectReplaceProperty(SystemConfigurationType.class, SystemObjectsType.SYSTEM_CONFIGURATION.value(), ItemPath.create(SystemConfigurationType.F_WORKFLOW_CONFIGURATION, WfConfigurationType.F_GENERAL_CHANGE_PROCESSOR, GeneralChangeProcessorConfigurationType.F_ENABLED), task, result, gcpConfig); }
/** * Create an instance of {@link WfConfigurationType } * */ public WfConfigurationType createWfConfigurationType() { return new WfConfigurationType(); }
@XmlSchemaType(name = "string") @XmlElement(name = "useDefaultApprovalPolicyRules") public DefaultApprovalPolicyRulesUsageType getUseDefaultApprovalPolicyRules() { return PrismForJAXBUtil.getPropertyValue(asPrismContainerValue(), F_USE_DEFAULT_APPROVAL_POLICY_RULES, DefaultApprovalPolicyRulesUsageType.class); }
public WfConfigurationType beginWorkflowConfiguration() { WfConfigurationType value = new WfConfigurationType(); workflowConfiguration(value); return value; }
@XmlElement(name = "primaryChangeProcessor") public PrimaryChangeProcessorConfigurationType getPrimaryChangeProcessor() { return PrismForJAXBUtil.getFieldSingleContainerable(asPrismContainerValue(), F_PRIMARY_CHANGE_PROCESSOR, PrimaryChangeProcessorConfigurationType.class); }
@XmlElement(name = "approverCommentsFormatting") public PerformerCommentsFormattingType getApproverCommentsFormatting() { return PrismForJAXBUtil.getPropertyValue(asPrismContainerValue(), F_APPROVER_COMMENTS_FORMATTING, PerformerCommentsFormattingType.class); }
@XmlElement(defaultValue = "true", name = "modelHookEnabled") public Boolean isModelHookEnabled() { return PrismForJAXBUtil.getPropertyValue(asPrismContainerValue(), F_MODEL_HOOK_ENABLED, Boolean.class); }
@Override public String toString() { return asPrismContainerValue().toString(); }