Metastorm BPM : User Action from a read only form


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:

function OpenAction(actionName)
{

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.

Advertisements

8 comments

  1. When (not if) the underlying unsupported functiuonality breaks, you will have to edit this over all your systems unless you contain it. As it is, it is fairly contained, but adding it to a library will ensure you only have to update it once.

    We tend to add it to a form segment and add that segment to any form requiring it, but we do notice from the architecture that this may not be optimal and it may be better to leave it open to ‘all’ forms.

  2. What is actually very useful here is the ability to invoke an action on another folder. This may be very useful, and is something that is requested often. I must say that we do not tend to do this ourselves.

  3. Very valid points Jerome and JEROME ;O). A lot of the non standard ‘injected’ HTML and other ‘objects’ (using the tag to embed controls into your forms) related tricks always come with their own risk (of removal or fixing by Metastorm). A centralized update point such as a map segment is exactly right and does promote minimal system down time if a standard fix needs to be implemented after a ‘patched’ upgrade (Though lets hope that Metastorm recognise these work arounds as required because of short falls in their default product functionality and introduce a useful replacement feature when they pull out any ‘outside the box’ enablers).

    Have you managed to apply this trick against another folder in another map Jerome? (you mention another folder, but is that just a different folder id ref within he same map?). I’d be interested in knowing if its been tested as possible in 7.6.

  4. I admire the valuable information you offer in your articles.Just thought you’d be interested to know that I have added you to my bookmarks You make right points in a concise and pertinent fashion, This is a really good read for me, many thanks to the author

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s