(session, context)
| 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 |
nothing calls this directly
no test coverage detected