MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / onTrigger

Method onTrigger

python/getFile.py:31–41  ·  view source on GitHub ↗
(session, context)

Source from the content-addressed store, hash-verified

29
30 def _onTriggerCallback(self):
31 def onTrigger(session, context):
32 flow_file = self.get(session, context)
33 if flow_file:
34 if flow_file.add_attribute("python_test","value"):
35 print("Add attribute succeeded")
36 if not flow_file.add_attribute("python_test","value2"):
37 print("Cannot add the same attribute twice!")
38 print ("original file name: " + flow_file.get_attribute("filename"))
39 target_relationship = "success"
40 if not self.transfer(session, flow_file, target_relationship):
41 print("transfer to relationship " + target_relationship + " failed")
42 return CALLBACK(onTrigger)
43
44

Callers

nothing calls this directly

Calls 4

add_attributeMethod · 0.80
get_attributeMethod · 0.80
getMethod · 0.45
transferMethod · 0.45

Tested by

no test coverage detected