/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ExecuteScriptType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ExecuteScriptType clone = ((ExecuteScriptType) super.clone()); // 'ScriptingExpression' property. clone.scriptingExpression = ((this.scriptingExpression == null)?null:copyOfScriptingExpression(this.getScriptingExpression())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType clone.input = ((this.input == null)?null:((this.getInput() == null)?null:this.getInput().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionEvaluationOptionsType clone.options = ((this.options == null)?null:((this.getOptions() == null)?null:this.getOptions().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingVariablesDefinitionType clone.variables = ((this.variables == null)?null:((this.getVariables() == null)?null:this.getVariables().clone())); return clone; } } catch (CloneNotSupportedException e) { // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError(e); } }
/** * Creates a new {@code ExecuteScriptType} instance by deeply copying a given {@code ExecuteScriptType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ExecuteScriptType(final ExecuteScriptType o) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 super(); if (o == null) { throw new NullPointerException("Cannot create a copy of 'ExecuteScriptType' from 'null'."); } // 'ScriptingExpression' property. this.scriptingExpression = ((o.scriptingExpression == null)?null:copyOfScriptingExpression(o.getScriptingExpression())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType this.input = ((o.input == null)?null:((o.getInput() == null)?null:o.getInput().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionEvaluationOptionsType this.options = ((o.options == null)?null:((o.getOptions() == null)?null:o.getOptions().clone())); // CClassInfo: com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingVariablesDefinitionType this.variables = ((o.variables == null)?null:((o.getVariables() == null)?null:o.getVariables().clone())); }
private ExecutionContext evaluateExpression(@NotNull ExecuteScriptType executeScript, Map<String, Object> initialVariables, boolean privileged, boolean recordProgressAndIterationStatistics, Task task, OperationResult result) throws ScriptExecutionException { Validate.notNull(executeScript.getScriptingExpression(), "Scripting expression must be present"); try { Map<String, Object> frozenVariables = VariablesUtil.initialPreparation(initialVariables, executeScript.getVariables(), expressionFactory, modelObjectResolver, prismContext, task, result); PipelineData pipelineData = PipelineData.parseFrom(executeScript.getInput(), frozenVariables, prismContext); ExecutionContext context = new ExecutionContext(executeScript.getOptions(), task, this, privileged, recordProgressAndIterationStatistics, frozenVariables); PipelineData output = evaluateExpression(executeScript.getScriptingExpression().getValue(), pipelineData, context, result); context.setFinalOutput(output); result.computeStatusIfUnknown(); context.computeResults(); return context; } catch (ExpressionEvaluationException | SchemaException | ObjectNotFoundException | RuntimeException | CommunicationException | ConfigurationException | SecurityViolationException e) { result.recordFatalError("Couldn't execute script", e); throw new ScriptExecutionException("Couldn't execute script: " + e.getMessage(), e); } }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { JAXBElement<? extends ScriptingExpressionType> theScriptingExpression; theScriptingExpression = this.getScriptingExpression(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "scriptingExpression", theScriptingExpression), currentHashCode, theScriptingExpression); } { ValueListType theInput; theInput = this.getInput(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "input", theInput), currentHashCode, theInput); } { ScriptingExpressionEvaluationOptionsType theOptions; theOptions = this.getOptions(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "options", theOptions), currentHashCode, theOptions); } { ScriptingVariablesDefinitionType theVariables; theVariables = this.getVariables(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "variables", theVariables), currentHashCode, theVariables); } return currentHashCode; }
lhsVariables = this.getVariables(); ScriptingVariablesDefinitionType rhsVariables; rhsVariables = that.getVariables(); if (!strategy.equals(LocatorUtils.property(thisLocator, "variables", lhsVariables), LocatorUtils.property(thatLocator, "variables", rhsVariables), lhsVariables, rhsVariables)) { return false;