public WfConfigurationType getWorkflowConfiguration(SystemObjectCache systemObjectCache, OperationResult result) throws SchemaException { PrismObject<SystemConfigurationType> systemConfiguration = systemObjectCache.getSystemConfiguration(result); if (systemConfiguration == null) { return null; } return systemConfiguration.asObjectable().getWorkflowConfiguration(); }
public WfConfigurationType getWorkflowConfiguration(ModelContext<? extends ObjectType> context, OperationResult result) { if (context != null && context.getSystemConfiguration() != null) { SystemConfigurationType systemConfigurationType = context.getSystemConfiguration().asObjectable(); return systemConfigurationType.getWorkflowConfiguration(); } PrismObject<SystemConfigurationType> systemConfigurationTypePrismObject = null; try { systemConfigurationTypePrismObject = systemObjectCache.getSystemConfiguration(result); } catch (SchemaException e) { throw new SystemException("Couldn't get system configuration because of schema exception - cannot continue", e); } if (systemConfigurationTypePrismObject == null) { // this is possible e.g. when importing initial objects; warning is already issued by Utils.getSystemConfiguration method return null; } return systemConfigurationTypePrismObject.asObjectable().getWorkflowConfiguration(); }
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 }
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); }