cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
hogi
Level XII

automate Workflow Builder - add Workflow Step

With an open Workflow Builder Window, is there a JSL command to add a workflow step with arguments to specify the JSL code and the "Notes" for the step?

 

 

11 REPLIES 11
jthi
Super User

Re: automate Workflow Builder - add Workflow Step

If you check scripting index for Workflow it is very limited

jthi_0-1731790134783.png

You can also check if there are any interesting commands using Show Properties on the workflow object

jthi_1-1731790181109.png

Some of these (like usually...) are not documented in scripting index but I would guess that none of these do what you are looking for. You might be able to write your own custom JSL to perform the actions you are looking for but it might require quite a lot (at one point I did start custom workflow script to allow for better report flow report creation but I never finished it). I would hope that JMP will make workflows easier to script in some future version of JMP.

-Jarmo
hogi
Level XII

Re: automate Workflow Builder - add Workflow Step

Ok, thanks.

The .jmpflow files have an easy structure, maybe I will add the changes there ...

hogi
Level XII

Re: automate Workflow Builder - add Workflow Step

on my way - a helpful change:

hogi_0-1731793420387.png

 

hogi
Level XII

Re: automate Workflow Builder - add Workflow Step

+ 1 step:

wf = open("mainFlow.jmpflow");
wf << Include workflow ("c:\temp\myworkflow.jmpflow")

nice : )

btw: If the workflow is already open, the return value of the open command is just a link to the window. So wf becomes a headbox instead of a scriptable workflow object.

hogi
Level XII

Re: automate Workflow Builder - add Workflow Step

with the same idea:

wf << add custom step(); //

wf << add custom step(Notes("hello")) // no additional effect

wf << add custom step("hello") // no additional effect 

hm, unfortunately, without the possibility to specify the Notes and JSL settings?

hogi
Level XII

Re: automate Workflow Builder - add Workflow Step

To run a workflow, one can try

nsteps= wf << Get Step Count;
wf <<Start Over();

for each({step},1::nsteps,
wf << Execute Next);

this will work if none of the steps is disabled. Otherwise the wirst steps will be executed twice.

 

Unfortunately, there is no << get enabled step count(). 

Re: automate Workflow Builder - add Workflow Step

There is limited JSL to use with the workflow - those steps were added so you could open workflows and run them if you had maybe an automated script daily.  Workflow is not really designed to be a JSL script that is written and added to - if you can do that, you can just write the JSL and use a script.  If you are an advanced scripter, you can add custom steps to the workflows, but the workflow is to automate your runs, and also really valuable to assist those that may not know scripting or like to write the script themselves.

hogi
Level XII

Re: automate Workflow Builder - add Workflow Step

Hi  @Mandy_Chambers , thank you for the information.
The available functionality is very helpful - especially the ability to use JSL scripting to include workflows in other workflows. very powerful!


@Mandy_Chambers wrote:

... you could open workflows and run them 


What command can I use to run the workflow?

Re: automate Workflow Builder - add Workflow Step

Names Default To Here( 1 );
wf = Open(
	"$SAMPLE_WORKFLOWS/WorkflowBuilder.jmpflow"
);
wf << Resume();

Resume will execute or resume execution