...
* Via simplest possible “morpher” plug-in
* Shows manipulation AFTER variable binding
* Morpher below is written in Java-style, not idiomatic Groovy...:
Code Block |
---|
class MyMorpher extends BasicMorpher |
...
{ def tweakValues(Map inputs, Map outputs) |
...
{ outputs[‘ENDPOINT'] = inputs[‘ADDR-IN'] + ”:" + inputs[‘PORT-IN'] |
...
} } |
...
Example-3: highly dependent coding using '''classifier''' “plug-in”
...
* Via simplest possible “classifier” plug-in
* Shows just-in-time schema name resolution
* Payload is parsed JSON (ie, arrays/maps)
* Classifier below is written in Java-style, not idiomatic Groovy...:
Code Block |
---|
class MyClassifier extends SimpleClassifier |
...
{ String classify(Object parsedPayload) // payload is parsed JSON |
...
{ if (parsedPayload.astuff) |
...
return “schema-A” |
...
else return “schema-B” |
...
} } |
Translation Pipeline
* Optional user-supplied plug-ins are shown green
[[File:PlasticPipeline.png|left]]
...