Hello dear people,
I would like to define or add a new parameter as global for a pipeline of type DirectoryType as Path. The path (DirectoryType) serves as the directory for all at runtime created files in the protocol .
In case the pipeline is used by another user, the directory should be determined with a mouse click, and the path should be global.
I appreciate any response or suggestions.
Thanks for your help,
Raed

Hi @RA. How are your users running this protocol? If you create a new protocol parameter of type DestinationType, that will allow the user to select a folder both when running the protocol in the Pipeline Pilot client and if the protocol is run through WebPort using the generic form generated by WebPort. If the parameter is called "DataFolder" you can use it in destination parameters of file writer components in two different ways. One is to set the value of the destination parameter to $(DataFolder)/somefilename.txt. The second is by right-clicking on the destination parameter name and choosing Initialize Using > PilotScript and then setting the script to @DataFolder . '/somefilename.txt'.
Dear Andrei CARACOTI,
Firstly, thank you for your kind response. The user is a regular user (not an admin) without web access and only as client protocol, the destination folder for numerous or many Writer files is intended to be defined during the initial launch of the pipeline. i will try to develop according to your answer then checking if I make any progress many thanks dear Andrei CARACOTI.
Hi @RA. If you mark the parameter as "Required" by checking the appropriate box in the parameter creation window as shown in the attached screenshot, and then save the protocol without a value in that parameter, the user will have to select their own folder before they can run the protocol. This way you ensure that they know where the data will be written.
Dear Andrei CARACOTI i set the Parameter (destination folder) with right click on white space in the protocol and set the parameter value as DataFolder as you show me and check the box, but i got the same result see attachment please
Hi @RA. I see that you created the parameter correctly. However, make sure that you set the Destination in the writer to something like this: $(DataFolder)/yourfilename. Note that the path uses a $, not the @ character. From your screenshots, it seems to me that you used @(DataFolder). The $(globalname) notation is called a string replacement token and allows users to use global property values in string type parameters. This token is replaced by Pipeline Pilot with the value of that global at initialization time. Please let me know if the above solves the issue you are seeing.
Dear Anderi CARACOTI I appreciate your help, and I have now corrected the issue. My mistake was not using the correct string; it should be $(DataFolder).'/somefilename.txt', and it is working now. I have one more question: Is there any way to allow the user to select their directory (path) for the first or one file, and then save the selected path as a variable to be used in the pipeline as the directory for other files? can i put instead of '/somefilename.txt' a name that saved in a global variable ?
Thank you again for your help.
Kind regards, Raed
Hi Raed. You can have the users select a file destination using a protocol-level parameter. You would create a protocol parameter of type URLType and then use that parameter value in the first reader, and then use a PilotScript script to select just the folder part of the path into a global and then use that global and add a new file name for every other file written in the protocol as you have done already. If you want the user to select a file in the first writer component in the protocol and from there have all the other writers write to the same folder, you could do something like the attached protocol. The first reader is in a subprotocol with the Destination parameter promoted so the user can select a file. Inside, the folder part of the Destination parameter value is extracted and saved to a global, and then the file is written normally. The second writer component in the protocol uses the global property created in the first writer subprotocol and writes a file to that same location.
Hi Raed. That file is part of the Pipelne Pilot installation. It's found under/apps/scitegic/generic/dataroot/data/Tables but here it is attached as well. You can also use any other file as well. The file itself is not important for the example so you can change it anything else.