[
https://issues.apache.org/jira/browse/NIFI-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15369201#comment-15369201
]
ASF GitHub Bot commented on NIFI-2020:
--------------------------------------
Github user YolandaMDavis commented on a diff in the pull request:
https://github.com/apache/nifi/pull/564#discussion_r70169616
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/TransformJSONResource.java
---
@@ -84,6 +84,36 @@ public Response executeSpec(JoltSpecificationDTO
specificationDTO) {
}
+ protected Transform getTransformation(JoltSpecificationDTO
specificationDTO) throws Exception{
+
+ Object specJson =
getSpecificationJsonObject(specificationDTO.getSpecification());
+ String transformName = specificationDTO.getTransform();
+ String modules = specificationDTO.getModules();
+
+ ClassLoader customClassLoader = null;
+ Transform transform ;
+ if(modules != null && !modules.isEmpty()){
+ customClassLoader =
ClassLoaderUtils.getCustomClassLoader(specificationDTO.getModules(),this.getClass().getClassLoader(),
getJarFilenameFilter());
+ }
+
+ if(transformName.equals("jolt-transform-custom")) {
+ transform =
TransformFactory.getCustomTransform(customClassLoader,specificationDTO.getCustomClass(),
specJson);
--- End diff --
agreed this code should be improved in general, which I'll take care of.
The case I should be covering here is the fact that customClassLoader could be
used with a custom transform or other transforms (such as a chain which can
contain custom transformations). The code assumes that if you selected custom
you should have a module set which isn't good to do. I'll update and get it out
here.
> Enhance JoltTransformJSON processor to support custom transforms
> ----------------------------------------------------------------
>
> Key: NIFI-2020
> URL: https://issues.apache.org/jira/browse/NIFI-2020
> Project: Apache NiFi
> Issue Type: New Feature
> Components: Core Framework
> Affects Versions: 1.0.0
> Reporter: Yolanda M. Davis
> Assignee: Yolanda M. Davis
> Fix For: 1.0.0
>
>
> Jolt supports additional custom transforms via fully-qualified Java
> classnames. Would like to provide the ability to support custom
> transformation (via drop in jars) for the Jolt Transform processor.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)