Task Script Tab
Allows you to configure a script the task must run.
Type
Three types of script are available : Javascript (to execute a JS contained in a file) or Freemarker (to execute Freemarker contained in a .ftl file) or PDF Transformation to generate a PDF document thanks to a XSL file
Your javascript file can only use process' variables defined or redefined (
a=${a}
) as input variable of your script taskVariables set by your Javascript or Freemarker will be available in
P_result.xxx
. Id of file created by PDF generation is available inP_result.id
You can also execute a JS in a Freemarker script
<@script env="javascript">a=b; setVariable("c",a);<!--@script-->
If you have a long running Freemarker script (list over 5000 items for instance), you should use this task since time spent on script execution is not count in total time execution of a process (which is limited to 10 minutes "in memory").
If you are not familiar with XSL/XSLT, please read this. Here is a site with different templates. Here is a tutorial to create a PDF document from a MS Word template.
Data in RunMyProcess must be a json and not a XML
Url
Enter url of JS, FTL or XSL file (or select a JS/FTL/XSL file hosted on RunMyProcess server or upload a JS/FTL/XSL file on RunMyProcess server).
Example of XSL file :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
Data source variable
This field is only available if Type is "PDF Transformation". It contains JSON structure to be treated by XSL file to generate a PDF document : ${mydata}
for instance.
Example of data :
1 |
|
New file name
Name of PDF file generated by task
Please give details of the problem