you can specify variable names there and pass the names to the acion (see the docs and examples on how to do this). The action can then retrieve the variable names and use it to retrieve the values in the actionhandler. What I created is something like this:
<action class="com.sample.action.MessageHandler"> <message>bla, bla, bla text</message> <recipient>proc_var</recipient> <initiator/> </action>
The 'message' is static and taken as a string by the actionhandler. The recipient points to a process variable which is to be used by this generic messagehandler and the 'initiator' is a direct reference to a process variable.
HOw do we receive these variables in the class?
I am attempting to pass the initiator user to the class, to call the db.
so I can test it like so
Have looked around but found nothing in the docs or other yet.
Come on James, you can do better than that. There is more info on this in the docs and the forum. The (wrong) assumption is that these are process variable names directly and will be filled by the engine. They aren't. If you have a variable in the actionhandler (not the process!!!) the variable is filled with the text within the tag (so the variable message in the actionhandler will get the value 'bla, bla, bla text')
If you want it to 'indicate' a variable, use the value of the variable as the name of a process variable and use the normal means to get it (the context).
I looked around, all I find is stuff like this:
and Ch 10 about context variables...
I understand that maybe I could pass a simple variable like this, but I need to get the swimlane user.
Can I just directly ask for the swimlane initiator in some way? I have been searching the forums and the web, but it returns too many results for swimlane itself to make the searches useful... this was the post closest in relation to my issue.
James, one tip: the search in the forum is an OR so you should put an AND between it, or use the other radiobutton.
Second tip: Look at the testcases. There are lots, and prove to be a valuable source of information (not documenation if you followed the 'other' thread ;-)
You will find things like
ProcessInstance processInstance = new ProcessInstance(processDefinition); processInstance.signal(); TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance(); TaskInstance changeNappy = (TaskInstance) taskMgmtInstance.getTaskInstances().iterator().next(); SwimlaneInstance stalker = taskMgmtInstance.getSwimlaneInstance("stalker"); assertEquals("me", stalker.getActorId()); assertEquals("me", changeNappy.getActorId())
The apidocs is also a valuable source of information
Just found it under the Swimlanetest right before I read this, thanks,
Yeah I keep forgetting the "and" option and getting way too many results...