Matt,
Thanks for the reply. And this is where I admit to being relatively new to
Java environments (having done mostly Python and C++ if you go back far
enough). So I understand if you don't have the cycles to give me too much
of a foundational lesson, but here is where I am stuck:
You said that I needed to "provide the properties [my]self", but I am not
sure what you mean by that.
With ExecuteScript, you do enter the properties in the processor config and
reference them directly. I understand the basic relationship between a
PropertyValue item and the asControllerService() method because that is
exactly what you use in ExecuteScript, you just don't have to do anything
special to "get" the property, it is just there.
I looked over the code, and I created a snippet below (based on your code
and with in between bits removed). Do I need to add the UUID for the
controller somewhere directly in here? I guess I am not 100% clear what I
am referencing and where to put my value in...
--------------------
class MyRecordProcessor extends AbstractProcessor {
// Properties
static final PropertyDescriptor CACHE_CLIENT = new
PropertyDescriptor.Builder()
.name("record-reader")
.displayName("Cachec Client")
.description("Specifies the Controller Service to use for
reading incoming data")
.identifiesControllerService(DistributedMapCacheClient.class)
.required(true)
.build()
@Override
protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
def properties = [] as ArrayList
properties.add(CACHE_CLIENT)
properties
}
@Override
void onTrigger(ProcessContext context, ProcessSession session) {
def flowFile = session.get()
if (!flowFile) return
def cachemap =
context.getProperty(CACHE_CLIENT).asControllerService(DistributedMapCacheClient)
--
Sent from: http://apache-nifi-users-list.2361937.n4.nabble.com/