[JBoss jBPM] - Re: required variables
by dleerob
I'm sure that would work fine. I actually created a quick fix method which does just that (as you can see below), and it did validate correctly. The method returns true if validation passes, and I then only call taskInstance.end(); Doing it this way for now, I am then able to get around the "end" bug aswell. I've pasted the method below which may help people with a workaround for now.
/**
| * A bug workaround method to validate that all required
| * variables in a task instance have been set.
| * @see Bug[2] at the bottom of this class.
| * @param taskInstance
| * @return boolean true if validation passes.
| */
| private boolean validateTaskInstanceVariables (TaskInstance taskInstance) {
| boolean pass = true;
| TaskController taskController = taskInstance.getTask().getTaskController();
| if (taskController != null) {
| List variableAccesses = taskController.getVariableAccesses();
| if (variableAccesses != null) {
| String missingTaskVariables = null;
| Iterator it = variableAccesses.iterator();
| while (it.hasNext()) {
| VariableAccess variableAccess = (VariableAccess) it.next();
| String mappedName = variableAccess.getMappedName();
| //first check if the required variableInstances are present
| if ((variableAccess.isRequired())
| && (!taskInstance.hasVariableLocally(mappedName)
| || taskInstance.getVariable(mappedName) == null)
| ) {
| if (missingTaskVariables==null) {
| missingTaskVariables = mappedName;
| }
| else {
| missingTaskVariables += ", "+mappedName;
| }
| }
| }
| // if there are missing, required parameters, set pass to false.
| if (missingTaskVariables != null) {
| log.debug("Missing task variables: "+missingTaskVariables);
| pass = false;
| }
| }
| }
| return pass;
| }
I can try and apply the patch on my system to test if validation works, but I am not building from source so would take me some time to setup my environment and get to it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084434#4084434
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084434
18 years, 9 months
[JBoss jBPM] - How is CompositeCommand used?
by estaub
Are there any tests, examples, documentation, wiki entries, forum entries, code comments, stickynotes, bathroom graffitti, or other sources of information on how to use CompositeCommand? If not, can someone illuminate me?
I can't find a darned thing.
My best guess from reading the code is that if the result of a command has a field with a name beginning with "previous", that is assignable from the result itself, and the next command has a field with the same "previous*" name, the result is copied into the "previous*" field on the subsequent command.
This doesn't make much sense to me, so I figure I must be confused again.
-Ed Staub
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084433#4084433
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084433
18 years, 9 months