/** * {@inheritDoc} */ @Override public void updateObjectInternal(final FUNCTIONIMPL object, final FUNCTIONIMPL updateObject) throws DMPPersistenceException { final LinkedList<String> parameters = object.getParameters(); updateObject.setParameters(parameters); updateObject.setFunctionDescription(object.getFunctionDescription()); super.updateObjectInternal(object, updateObject); }
/** * {@inheritDoc}<br/> * Updates the name, description, parameters and machine processable function description of the function. */ @Override protected POJOCLASS prepareObjectForUpdate(final POJOCLASS objectWithUpdates, final POJOCLASS object) { super.prepareObjectForUpdate(objectWithUpdates, object); object.setFunctionDescription(objectWithUpdates.getFunctionDescription()); object.setParameters(objectWithUpdates.getParameters()); return object; } }
function.setFunctionDescription(metafactureFunctionDescriptionJSON);
@Override public Function createAndPersistDefaultObject() throws Exception { final String functionName = "trim"; final String functionDescription = "trims leading and trailing whitespaces from a given string"; final String functionParameter1 = "inputString"; final String functionParameter2 = "parameter2"; final String functionFunctionDescriptionString = DMPPersistenceUtil.getResourceAsString("function_description.prettyprint.json"); Assert.assertNotNull("the function description JSON string shouldn't be null", functionFunctionDescriptionString); final ObjectNode functionFunctionDescription = objectMapper.readValue(functionFunctionDescriptionString, ObjectNode.class); Assert.assertNotNull("the function description JSON shouldn't be null", functionFunctionDescription); // TODO: think about this? final String functionUUID = UUIDService.getUUID(Function.class.getSimpleName()); final Function function = new Function(functionUUID); function.setName(functionName); function.setDescription(functionDescription); function.addParameter(functionParameter1); function.addParameter(functionParameter2); function.setFunctionDescription(functionFunctionDescription); return createAndCompareObject(function, function); }
function.setDescription(functionDescription); function.addParameter(functionParameter); function.setFunctionDescription(functionFunctionDescription);