-
1. Re: Some questions about the script execution code
rebody Aug 6, 2010 10:46 AM (in response to mwohlf)Hi Michael,
I will try to answer your questions. If I had any mistakes, please correct me.
1.ScriptManager is used to manage script like juel, bsh, groovy to integrate into pvm. Before jBPM-4.4, we used juel to be the default expression language. But in jBPM-4.4, Tom created a new package named org.jbpm.pvm.internal.el. And all of expressions should be evaluated by this package. We won't use ScriptManager to evaluate expression directly.
So now, The only place that used ScriptManager is in the org.jbpm.pvm.internal.el.Expression. If we create a Expression which language is not UEL_VALUE or UEL_METHOD, it will use ScriptManager to evaluate the script by specified language.
And I find both evaluateExpression() and evaluateScript() are using evaluate() internal. There is no different between them. So we just using evaluateExpression() to do all of work about eval script. Maybe sometimes it become much confused.
2.EnvironmentBinding had not finished yet. We just removed all of IllegalStateException in jBPM-4.4 in order to get more feeback from community. I think we could finish it in the next version, like achieve the put() method to store data into process variable.
3.Did we have to achieve the readContext and writeContext. In which scenarios we should use them? If they are not neccessary, I want to deprecated them in the next version, so we could delete them in the future.
4.How should we refactor TaskContext and ExecutionContext. A long times ago, Tom said he want to refacter the TaskContext and ExecutionContext, But he didn't make it more clearly. if we could make a good plan, we could finish this work by ourselves.
Any reply will be apprieciated. Thank you very much.
-
2. Re: Some questions about the script execution code
mwohlf Aug 6, 2010 12:26 PM (in response to rebody)Hi HuiSheng,
thanks a lot for your reply,
[..]
And I find both evaluateExpression() and evaluateScript() are using evaluate() internal. There is no different between them. So we just using evaluateExpression() to do all of work about eval script. Maybe sometimes it become much confused.
the problem I see here is that a script might get executed with the default expression language instead with the default script language, this part of the source is indeed very confusing can't we just remove the evaluateExpression() and evaluateScript() and in general use the evaluate() method and throw an exception if the execution language is not specified, this would be more in line with the rest of the code in my opinion.
[...]
2.EnvironmentBinding had not finished yet. We just removed all of IllegalStateException in jBPM-4.4 in order to get more feeback from community. I think we could finish it in the next version, like achieve the put() method to store data into process variable.
I didn't think of this, but it would be a cool feature to have a groovy script write to process variables
[...]
3.Did we have to achieve the readContext and writeContext. In which scenarios we should use them? If they are not neccessary, I want to deprecated them in the next version, so we could delete them in the future.
I also don't see an urgent need for them, the read contexts are hard coded now as far as I understand?
The write context would be where ever the variable is declared?
[...]
4.How should we refactor TaskContext and ExecutionContext. A long times ago, Tom said he want to refacter the TaskContext and ExecutionContext, But he didn't make it more clearly. if we could make a good plan, we could finish this work by ourselves.
Could they be used to have access to task scoped and execution scoped variables, at least this would make sense to me :-/ right now the TaskContext just gives access to the task itself, so a script can do stuff like task.getVariable('varname')
-
3. Re: Some questions about the script execution code
rebody Aug 8, 2010 6:02 AM (in response to mwohlf)Hi Michael,
I am agree with you about merge evaluateExpression() and evaluateScript() for ScriptManager. The other questions we still need a more clearly plan.