Hi All,
Working on a project where we are using a Ruby script in a multiscript activity. Following it's completion, we'd like to be able to pass results back to the workflow to use downstream. e.g. populate variables like instance.vars.xxxxx
Can anyone expand pass results back to a workflow from a multiscript activity? (whether it be python/ruby/shell etc)
Thanks
David
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Clearly I meant to say in final sentence:
Can anyone expand on how to pass results back to a workflow from a multiscript activity? (whether it be python/ruby/shell etc)
Views
Replies
Total Likes
Hello @davidh2892249 You can create a file with your script, write data in the file and then use data loading activity to read the file on server.
Views
Replies
Total Likes
Hi Manoj
Thanks for your reply.
I guess my question there would be how do you pass the name of the file back to the workflow as vars.filename so that the dataloading activity knows which file to pick up?
We've come up with a solution where we "calculate" a name, but ideally we'd like to pass explicit outputs of the script back to the workflow.
Any thoughts would be appreciated.
Thanks
David
Views
Replies
Total Likes
Hello @davidh2892249 You can use the dynamic file name in the file upload activity and select calculated option.
Views
Replies
Total Likes
Hi Manoj
Thanks, I think you are suggesting using a calculated name that matches what we ASSUME will be the filename generated by the ruby script.
We can do that by giving the ruby script variables FROM the workflow and generate a filename based on a pattern, and then make the calculated name in the file upload activity match that pattern.....
We have a solution working like that, but what I'm looking to better understand is how can you pass an output from a ruby script back from a workflow - so that the workflow can process explicit (rather than assumed) info from the ruby script.
I hope this makes sense.
Thanks
David
Views
Replies
Total Likes
Hi @davidh2892249 ,
To handle explicit outputs from external scripts like Ruby in ACC, you can try these two approaches:
Option 1: Handling Files Directly
File.open('output_data.csv', 'w') { |file| file.write("Header1,Header2\nData1,Data2") }
File.open('metadata.txt', 'w') { |file| file.write("output_data.csv") }
Option 2: Integrating with External Services (via ACC)
If the logic is complex and needs Ruby or another language, execute it externally (e.g., on a server) and then capture the results.
// Define the API endpoint URL
var url = "https://your-external-service.com/api";
// Create an instance of HttpClientRequest
var request = new HttpClientRequest(url);
// Optionally, set the HTTP method and headers if needed
request.method = "GET"; // HTTP method (GET, POST, etc.)
request.headers["Content-Type"] = "application/json"; // Set headers using bracket notation
// Execute the request
var response = request.execute();
// Capture the result from the response
var result = response.content;
// Set the result to a workflow variable
instance.vars.myVariable = result;
Choose the approach that aligns best with your workflow requirements and the capabilities of ACC.
Best regards,
MEIT MEDIA (https://www.meitmedia.com)
Contact Us: infomeitmedia@gmail.com
Views
Likes
Replies