You are viewing limited content. For full access, please sign in.

Question

Question

workflow running external script

asked on March 1, 2017

Hi!

I'm trying to create or call windows script from workflow.

I have a windows script (.bat) that collects some information and loads it into a custom SQL table for WF to reference. This is to collect customer information out of another system. The script seems to work fine.

My issue is that i'd like to be able to run this script from the workflow.  Even better, pass in an ID so it can control the information collected.

The script uses an ID to determine which customers details to collect. ideally i want to input the ID from a LF token then run the script.

Or is it possible to execute windows commands directly with the script activity?

Does anyone have any ideas?

 

Thanks

Mark

0 0

Replies

replied on March 2, 2017

Check out this StackOverflow post: http://stackoverflow.com/a/33633148

I've used this approach to do something similar. 

For the Process.StartInfo.Arguments, you can use GetTokenValue("Entry ID") to pass the entry ID to your .bat file. Of course, you can change Entry ID to the name of the token you need, if different.

You can then reference that ID via %1 in the batch file itself, assuming that's the first argument you're passing along. 

In our setup, the batch file is on a share, we have the WF service running as a network account, and needed to give that account the appropriate permissions on that share to run the batch file.

0 0
replied on March 2, 2017

Hi!

Thanks, thats a big help. i can get it to run. i've got the script using the %1.

I've still yet to sort out the Process.StartInfo.Arguments bit, but i feel like i'm almost there.

 

Thanks

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.