Initiating a user action from a form can be a useful and efficient design tip. It is quite possible to launch a user action from a button, but only within the same workflow and from a read only view. The reason the folder needs to be in read only mode is because when the folder is in ‘action’ mode, the folder row is locked on the database. To my knowledge and testing, I’m unable to open just any old folder action (so an action from a different workflow within the same procedure file). For launching an action from a button, here’s how its done:
1) Create the following client side function:
var IBaseOpener = new esOpener(“folder_action”);
var IChildOpener = esFolderActionFormOpener(IBaseOpener);
IChildOpener.openWindow(“”,”Metastorm BPM Server”,document.getElementById(“FolderID”).value,document.getElementById(“FolderID”).value,actionName,””);
2) Add a button to your form and set its action to ‘client operation’.
3) Add a button press script call – OnClick=OpenAction (“NextAction”)&Language=JScript (you’ll see that we are passing the name of the action we want to kick start).
This is tested as working in Metastorm 7.6. Remember that the user clicking the button must have role access to performing this action, otherwise errors will occur.
One final point on this subject is around the eServiceName of your Metastorm BPM server. The code above assumes the out of the box service name of ‘Metastorm BPM Server’… If you or a colleague in IT know something about Metastorm and have been mucking about in the web config file, you’ll know that you can change the service name. Just be aware that if you have Dev, Test and Live Metastorm servers with different service names, you’ll need to use the eServiceName variable when implementing the above code.