Hierarchy parser needs an absolute path of the Json/Xml file in input. One can pass it either from Source, Taskflow, Database, etc.
Based on my understanding of the use case. You can try the following:
Create a mapping with the In-out parameter (filepath). Using an expression, map it to the Hierarchy Parser input. Refer to the below screenshot.
Note: FilePathexp has filepath in-out parameter assigned to it via Expression transformation & I'm using a dummy source here.
Trigger the Tasflow using a FileListener. Choose the Data Task in it.
Add in-out parameter in the input of DataTask & map it with the filepath(path) coming from File Listener. Here is the screenshot for your reference
I'm assuming that Filelistener is picking the xml/json file from the desired location.
Here are a few kb's that you can use for reference :
Hope this helps.