/** * Create an instance of {@link ValueListType } * */ public ValueListType createValueListType() { return new ValueListType(); }
public ValueListType value(Object value) { getValue().add(value); return this; }
return copyOf(((boolean[]) array)); return copyOf(((byte[]) array)); return copyOf(((char[]) array)); return copyOf(((double[]) array)); return copyOf(((float[]) array)); return copyOf(((int[]) array)); return copyOf(((long[]) array)); return copyOf(((short[]) array)); Array.set(copy, i, copyOf(Array.get(array, i)));
/** * Creates a new {@code ValueListType} instance by deeply copying a given {@code ValueListType} instance. * * * @param o * The instance to copy. * @throws NullPointerException * if {@code o} is {@code null}. */ public ValueListType(final ValueListType 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 'ValueListType' from 'null'."); } // 'Value' collection. if (o.value!= null) { copyValue(o.getValue(), this.getValue()); } }
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(); } }
@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; } };
return copyOfArray(o); return copyOf(((JAXBElement) o)); } catch (NoSuchMethodException e) { if (o instanceof Serializable) { return copyOf(((Serializable) o));
/** * 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); } }
public boolean equals(Object object) { final EqualsStrategy strategy = DomAwareEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
/** * Creates and returns a deep copy of this object. * * * @return * A deep copy of this object. */ @Override public ValueListType clone() { try { { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 final ValueListType clone = ((ValueListType) super.clone()); // 'Value' collection. if (this.value!= null) { clone.value = null; copyValue(this.getValue(), clone.getValue()); } 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())); }
/** * Create an instance of {@link ValueListType } * */ public ValueListType createValueListType() { return new ValueListType(); }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<Object> theValue; theValue = (((this.value!= null)&&(!this.value.isEmpty()))?this.getValue():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); } return currentHashCode; }
/** * Copies all values of property {@code Value} deeply. * * @param source * The source to copy from. * @param target * The target to copy {@code source} to. * @throws NullPointerException * if {@code target} is {@code null}. */ @SuppressWarnings("unchecked") private static void copyValue(final List<Object> source, final List<Object> target) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if ((source!= null)&&(!source.isEmpty())) { for (final Iterator<?> it = source.iterator(); it.hasNext(); ) { final Object next = it.next(); if (next instanceof Object) { // CBuiltinLeafInfo: java.lang.Object target.add(copyOf(((Object) next))); continue; } // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Value' of class 'com.evolveum.midpoint.xml.ns._public.model.scripting_3.ValueListType'.")); } } }
/** * Create an instance of {@link ValueListType } * */ public ValueListType createValueListType() { return new ValueListType(); }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof ValueListType)) { return false; } if (this == object) { return true; } final ValueListType that = ((ValueListType) object); { List<Object> lhsValue; lhsValue = (((this.value!= null)&&(!this.value.isEmpty()))?this.getValue():null); List<Object> rhsValue; rhsValue = (((that.value!= null)&&(!that.value.isEmpty()))?that.getValue():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { return false; } } return true; }
/** * Creates and returns a deep copy of a given {@code JAXBElement} instance. * * @param element * The instance to copy or {@code null}. * @return * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. */ @SuppressWarnings("unchecked") private static JAXBElement copyOf(final JAXBElement element) { // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000 if (element!= null) { final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); copy.setNil(element.isNil()); copy.setValue(copyOf(copy.getValue())); return copy; } return null; }
public ValueListType beginInput() { ValueListType value = new ValueListType(); input(value); return value; }
if (executeScriptRequestTemplate.getInput() != null && !executeScriptRequestTemplate.getInput().getValue().isEmpty()) { LOGGER.warn("Ignoring input values in executeScript data in task {}", coordinatorTask);
@Test public void testParseTaskFile() throws Exception { System.out.println("===[ testParseTaskFile ]==="); // GIVEN PrismContext prismContext = PrismTestUtil.getPrismContext(); // WHEN PrismObject<TaskType> task = prismContext.parserFor(TASK_FILE).xml().parse(); // THEN System.out.println("Parsed task:"); System.out.println(task.debugDump()); assertTask(task); Item executeScriptItem = task.findExtensionItem(new QName("executeScript")); ExecuteScriptType executeScript = (ExecuteScriptType) executeScriptItem.getRealValue(); Object o = executeScript.getInput().getValue().get(0); System.out.println(o); assertTrue("Raw value is not parsed", o instanceof RawType && ((RawType) o).getAlreadyParsedValue() != null); }