From the command line help pages, I learned that I can use this format to pass parameters into a workflow programmatically:
AlteryxEngineCmd.exe "<WizardValues ShowDebugMessages='False'><Module>MyAnalyticApp.yxwz</Module><Value name='FILEINPUT'>TEST.CSV</Value></WizardValues>"
However, my workflow has a macro in it, and whenever I run the following statement, the macro can't be found. The workflow runs fine from within Alteryx, and used to run fine from the command line until I started running it using the xml string.
My command:
"C:/Program Files/Alteryx/bin/AlteryxEngineCmd.exe" "<WizardValues ShowDebugMessages='False'><Module>a-salesforce-output-test-with-macro.yxwz</Module><Value name='startEpoch'>1503708605</Value></WizardValues>"
Output:
AlteryxEngineCmd.exe Version 11.5.0.31895 c Alteryx, Inc. - All Rights Reserved. Started running <WizardValues ShowDebugMessages='False'><Module>a-salesforce-output-test-with-macro.yxwz</Module><Value name='startEpoch'>1503708605</Value></WizardValues> Error - ToolId 80: Cannot find macro "TestMessageV2.yxmc". ToolId 2: 1 record was output ToolId 83: startEpoch: 1503708605 Alteryx Engine: Tool #74: Tool #6: 1 records were successfully parsed and 0 were not. Alteryx Engine: Tool #74: Tool #9: 1 records were True and 0 were False Finished in 0.694 seconds with 1 error
Cannot find macro "TestMessageV2.yxmc" - I'm assuming I need to pass this into the the xml string but I've tried some different things with no dice. I have a couple of questions.
1. How can I run this workflow that contains a macro from the command line?
2. Is it possible to pass parameters into the sub-macro from the command line?
Attached are the Workflow and the Macro used within it.
Thanks in advance!
PS: The whole purpose of this is for the macro in there to calculate the run time of the workflow and post that along with the test information to an endpoint. If there's a better way to do this that would be great to know too!
解決済! 解決策の投稿を見る。
I don't have the license rights to test, but my first thought would be to use an absolute path instead of a relative path for the macro reference.
Currently in the XML of the .yxwz file, there is a line:
<EngineSettings Macro="TestMessageV2.yxmc" />
What if you changed it to the full path where the .yxmc file is, like:
<EngineSettings Macro="C:\folder\TestMessageV2.yxmc" />
That was it! Thanks @Joe_Mako :-)
Thanks to @Joe_Mako's excellent observation, I have discovered the proper solution to this problem. You must specify the full path of the module-containing-workflow in the command line as such:
"C:/Program Files/Alteryx/bin/AlteryxEngineCmd.exe" "<WizardValues ShowDebugMessages='False'><Module>C:\Users\jarnold\Desktop\a-salesforce-output-test-with-macro.yxwz</Module><Value name='startDateTime'>1503708605</Value></WizardValues>"
Hi @Joe_Mako
In case of batch macro, it runs only once.
Expected it to run for all rows of data individually.
Do we need to update the xml for macro as well.