psagarna (11) [Avatar] Offline
#1
Hi,

I´m trying to reproduce the example of this section but using this values but I have the next exception:
Also I have create the class with public class Ej4 implements Serializable.

<serviceTask id="servicetask1" name="Validate Task" activiti:expression="#{ej4.validate()}" activiti:resultVariableName="validatetime"></serviceTask>

Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'ej4'
at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79)
at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75)
at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)
at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)

I´m wondering Where Can I specified in the process the project var ej3 as type of Ej4

Kind regards,

Pablo.
psagarna (11) [Avatar] Offline
#2
Re: 4.3.4 Java service task with method and value expressions
It is ok now. It is for run is necesary to add the variable in the map in the test case.

But one thing it is not clear for me. If I would like to add to the project generic project vars. Where can I add them? In the start activiti? How I initialize them?

Many thanks,

Cheers,

Pablo.
tijs.rademakers (494) [Avatar] Offline
#3
Re: 4.3.4 Java service task with method and value expressions
Hi,

You can add them when you invoke the startProcessInstanceByKey method or use the RuntimeService to set variables on a later moment.

Best regards,

Tijs
jerryfiunam (61) [Avatar] Offline
#4
Re: 4.3.4 Java service task with method and value expressions
Hi Tijs,

I am now in this thread smilie.

I just have a doubt regarding this chapter and chapter 5. In chapter four you explain a lot about expressions, but when I tried to test the final example of chapter 5 that uses expressions I had erros that I worked it out till they were not shown anymore, the problem was with EXPRESSION beacuse in chapter 4 you explain that expresions are in the form of "#{bean.xxx}" (specifically in pages 90 and 94) but in other pages they are in the form "${bean.xxx}" and when I tried the example I tried with the form "#{bean.xxx}" which did not work, rather I just changed "#" by "$" and everything went ok.

It is just about if "#" was a mistake in pages 90 and 94 or both "#" and "$" can be used equally for expressions?

Regards,

Jerry
tijs.rademakers (494) [Avatar] Offline
#5
Re: 4.3.4 Java service task with method and value expressions
Hi Jerry,

Good question, it has come across my mind multiple times also. So now you asked it it was a good time to actually do some tests. And my findings are that they can be used both. I didn't find any difference between the two until now. Event in the Activiti user guide they are used both.

Best regards,

Tijs