the correct way is by using the api as you did, just not from within actionhandlers.
Thanx for your reply. Actually I want to have the pause/resume occur in response to some preprocessing before node execution (which checks for availibility of resources). The process is paused if required resources are unavailable, and resumed when the resources do become available. Since this is a generic activity and must occur before execution of every action, the best solution that comes to mind is to have the resource check occur either in transition handlers or in the node-enter event handlers.
Theres no way I can think of for me to step in between nodes to check availibility of resources from outside. Can u tell me if I can do this from outside of any actionhandlers?
I think the way to do this could be to use a state combined with a timer. The timer would expire immediately and have a repeat cycle that you need to periodically check for the availability of your resources. If they are available, the action in your timer signals the processinstance to move out of the state and continue to the next state.