use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionEvaluationOptionsType in project midpoint by Evolveum.
the class PipelineData method prepareXmlData.
public static PipelineDataType prepareXmlData(List<PipelineItem> output, ScriptingExpressionEvaluationOptionsType options) {
boolean hideResults = options != null && Boolean.TRUE.equals(options.isHideOperationResults());
PipelineDataType rv = new PipelineDataType();
if (output != null) {
for (PipelineItem item : output) {
PipelineItemType itemType = new PipelineItemType();
PrismValue value = item.getValue();
if (value instanceof PrismReferenceValue) {
// This is a bit of hack: value.getRealValue() would return unserializable object (PRV$1 - does not have type QName)
ObjectReferenceType ort = new ObjectReferenceType();
ort.setupReferenceValue((PrismReferenceValue) value);
itemType.setValue(ort);
} else {
itemType.setValue(value.getRealValue());
}
if (!hideResults) {
itemType.setResult(item.getResult().createOperationResultType());
}
rv.getItem().add(itemType);
}
}
return rv;
}
use of com.evolveum.midpoint.xml.ns._public.model.scripting_3.ScriptingExpressionEvaluationOptionsType in project midpoint by Evolveum.
the class ModelWebService method prepareXmlData.
public static PipelineDataType prepareXmlData(List<PipelineItem> output, ScriptingExpressionEvaluationOptionsType options) throws JAXBException, SchemaException {
boolean hideResults = options != null && Boolean.TRUE.equals(options.isHideOperationResults());
PipelineDataType rv = new PipelineDataType();
if (output != null) {
for (PipelineItem item : output) {
PipelineItemType itemType = new PipelineItemType();
PrismValue value = item.getValue();
if (value instanceof PrismReferenceValue) {
// This is a bit of hack: value.getRealValue() would return unserializable object (PRV$1 - does not have type QName)
ObjectReferenceType ort = new ObjectReferenceType();
ort.setupReferenceValue((PrismReferenceValue) value);
itemType.setValue(ort);
} else {
// TODO - ok?
itemType.setValue(value.getRealValue());
}
if (!hideResults) {
itemType.setResult(item.getResult().createOperationResultType());
}
rv.getItem().add(itemType);
}
}
return rv;
}
Aggregations