/** * Create an instance of {@link ValueListType } * */ public ValueListType createValueListType() { return new ValueListType(); }
/** * Create an instance of {@link ValueListType } * */ public ValueListType createValueListType() { return new ValueListType(); }
/** * Create an instance of {@link ValueListType } * */ public ValueListType createValueListType() { return new ValueListType(); }
public ValueListType beginInput() { ValueListType value = new ValueListType(); input(value); return value; }
@Override protected boolean handleObject(PrismObject<ObjectType> object, Task workerTask, OperationResult result) { try { ExecuteScriptType executeScriptRequest = executeScriptRequestTemplate.clone(); executeScriptRequest.setInput(new ValueListType().value(object.asObjectable())); ScriptExecutionResult executionResult = scriptingService.evaluateExpression(executeScriptRequest, emptyMap(), false, workerTask, result); LOGGER.debug("Execution output: {} item(s)", executionResult.getDataOutput().size()); LOGGER.debug("Execution result:\n{}", executionResult.getConsoleOutput()); result.computeStatus(); } catch (ScriptExecutionException | SecurityViolationException | SchemaException | ObjectNotFoundException | ExpressionEvaluationException | CommunicationException | ConfigurationException e) { result.recordFatalError("Couldn't execute script: " + e.getMessage(), e); LoggingUtils.logUnexpectedException(LOGGER, "Couldn't execute script", e); } return true; } };
private void executeScript(ScriptExecutionPolicyActionType action, EvaluatedPolicyRule rule, ModelContext<?> context, Task task, OperationResult parentResult, ExecuteScriptType executeScriptBean) { OperationResult result = parentResult.createSubresult(EXECUTE_SCRIPT_OPERATION); try { Map<String, Object> initialVariables = createInitialVariables(action, rule, context); if (executeScriptBean.getInput() == null && context.getFocusContext() != null) { PrismObject objectAny = ((LensFocusContext) context.getFocusContext()).getObjectAny(); if (objectAny != null) { ValueListType input = new ValueListType(); input.getValue().add(objectAny.getValue().clone()); executeScriptBean.setInput(input); } } scriptingExpressionEvaluator.evaluateExpression(executeScriptBean, initialVariables, false, task, result); } catch (ScriptExecutionException | RuntimeException e) { result.recordFatalError("Couldn't execute script policy action: " + e.getMessage(), e); LoggingUtils.logUnexpectedException(LOGGER, "Couldn't execute script with id={} in scriptExecution policy action '{}' (rule '{}'): {}", e, action.getId(), action.getName(), rule.getName(), e.getMessage()); } finally { result.computeStatusIfUnknown(); } }