You can pass properties of more than one element to an OS command tool using mass processing.
As soon as an OSCommand tool descriptor is used within a mass processing action descriptor, a parameter file will be generated by the Workflow Manager and added to the OS command. The file is created in the Eclipse workspace, and will contain values of all modeled input parameters of the type MassProcessing. Each selected element will be represented by a single line in the file. The full qualified file name will be added as the last OS command argument in double quotes.
The following pattern is used to create the parameter file:
INPARM0001: <element 1 parm 1><separator>(…)<element 1 parmn> INPARM0002: <element 1 parm 1><separator>(…)<element 2parmn> (…) INPARMnnnn: <element nparm 1><separator>(…)<element nparmn>
(3 elements selected):
INPARM0001: Folder_1+_+File 1+_+TEXTFILE INPARM0002: Folder_1+_+File 2+_+TEXTFILE INPARM0003: Folder_1+_+File 3+_+TEXTFILE
(The input parameter separator is “+_+”.)
Note that the mass input parameters have the type "MassProcessing". The "ToolDefinedResourceOperations" output parameters are used for tool-defined resource operations. This tool in particular returns a REMOVE-ELEMENT: resource operation for every deleted file.
./massdelete.sh "<workspace path><application path>/PARMLIST.txt"
A called tool will have to parse the parameter file (usually line by line) to process the selection. Tool-defined resource operations or messages can be returned to provide feedback to the user.