-
1. Re: Problem using expression language in a process definitio
kukeltje Sep 24, 2007 11:59 AM (in response to sonicfab)correct... not all params can be EL. The duedate e.g. can't. File a jira issue for this....or better, look in the source of jbpm to see how to achieve this (it is realy easy)
-
2. Re: Problem using expression language in a process definitio
sonicfab Sep 24, 2007 12:09 PM (in response to sonicfab)"kukeltje" wrote:
correct... not all params can be EL. The duedate e.g. can't. File a jira issue for this....or better, look in the source of jbpm to see how to achieve this (it is realy easy)
I appreciate your answer, but also find it somewhat weird : if you know the answer, and if it is indeed real easy, why don't you post it here so that it is shared with everyone ? This forum is not a game. -
3. Re: Problem using expression language in a process definitio
kukeltje Sep 24, 2007 1:19 PM (in response to sonicfab)Fabien, please..... do not start with these kinds of remarks..
Easy meaning about 1 day work if you start from scratch (e.g. see start with how an attribute known to support this) For me it is about half a day's work since I've done it once before.
..... writing unittests, docs, implementing the code, etc... -
4. Re: Problem using expression language in a process definitio
sonicfab Sep 25, 2007 12:19 PM (in response to sonicfab)Ok I've looked into it a bit, and it seems that the quickest way to achieve this, without modifying the jPDL schema, is to override the read(Element actionElement, JpdlXmlReader jpdlReader) method of class org.jbpm.scheduler.def.CreateTimerAction. The overriden method can then call the org.jbpm.jpdl.el.impl.ExpressionEvaluatorImpl class.
Do you agree with this ? -
5. Re: Problem using expression language in a process definitio
kukeltje Sep 25, 2007 1:27 PM (in response to sonicfab)Seems about correct. But why is modification of the schema needed? Maybe I miss something (have no access to the code now, will look into that tonight).
I saw you made a jira entry thanks http://jira.jboss.com/jira/browse/JBPM-1060 -
6. Re: Problem using expression language in a process definitio
sonicfab Sep 26, 2007 4:22 AM (in response to sonicfab)Why do I talk about modifying the schema ? Well, I had a look at the jpdl-3.2 schema, and apparently all the objects that can handle EL have a "expression" attribute, whereas objects that can't don't seem to have one.
For example, the action element :<xs:element name="action"> <xs:complexType mixed="true"> <xs:sequence> <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="class" type="xs:string" /> <xs:attribute name="config-type" default="field"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="field"/> <xs:enumeration value="bean"/> <xs:enumeration value="constructor"/> <xs:enumeration value="configuration-property"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="name" type="xs:string" /> <xs:attribute name="ref-name" type="xs:string" /> <xs:attribute name="accept-propagated-events" type="booleanType" default="true" /> <xs:attribute name="expression" type="xs:string" /> <xs:attribute name="async" type="xs:string" /> </xs:complexType> </xs:element>
Whereas for example for the timer element :<xs:element name="timer"> <xs:complexType> <xs:choice minOccurs="0"> <xs:element ref="action"/> <xs:element ref="script"/> </xs:choice> <xs:attribute name="duedate" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" /> <xs:attribute name="repeat" type="xs:string" /> <xs:attribute name="transition" type="xs:string" /> </xs:complexType> </xs:element>
-
7. Re: Problem using expression language in a process definitio
kukeltje Sep 26, 2007 4:52 AM (in response to sonicfab)ahh... no that is not needed. The name attribute of a subprocess can also be an EL. The expression attribute is only used in situations where the 'term' expression is appropriate.
In the same way you could make the repeat attribute accept an EL..... but remember... test test test ;-)