Skip to main content



      Home
Home » Modeling » MDT (Model Development Tools) » [bpmn2] Convert Expression to FormalExpression
[bpmn2] Convert Expression to FormalExpression [message #667591] Fri, 29 April 2011 14:40 Go to next message
Eclipse UserFriend
Sorry if this is simple question..I would like to know how to either:

a) get the value of an Expression, for example if i have:

<timerEventDefinition>
<timeCycle>5s</timeCycle>
</timerEventDefinition>

timeCycle is going to be of type org.eclipse.bpmn2.impl.ExpressionImpl and not a FormalExpression..and I am not sure how to get the value "5s" out of it?

If instead I have <timeCycle xsi:type="tFormalExpression">5s</timeCycle> then its not an issue because this will be a FormalExpression with a getBody() method that lets me get to the body value.

b) Possible be able to convert Expression (cast or something) to FormalExpression ..is this possible?

Any inputs are much welcome..
Thanks!
Re: [bpmn2] Convert Expression to FormalExpression [message #668154 is a reply to message #667591] Wed, 04 May 2011 03:43 Go to previous message
Eclipse UserFriend
Hello,

an Expression (in contrast to a FormalExpression) does not map text in its body to an attribute in the metamodel. Instead, the natural-language text specifying the expression should be stored in the documentation attribute:
Quote:
The Expression class is used to specify an Expression using natural-language text. These Expressions are not executable. The natural language text is captured using the documentation attribute, inherited from BaseElement.


Thus, the XML for your scenario should look somewhat like this:
  <bpmn2:timerEventDefinition>
    <bpmn2:timeCycle>
      <bpmn2:documentation>5s</bpmn2:documentation>
    </bpmn2:timeCycle>
  </bpmn2:timerEventDefinition>


I am aware that the BPMN 2 XML Schema defines Expression as an XML element with mixed content (so your XML is valid), but the metamodel does not define an attribute or reference to which this content could be mapped.

Best regards,
Henning
Previous Topic:[BPMN2] extract information by procedure
Next Topic:customization
Goto Forum:
  


Current Time: Fri Apr 25 19:20:22 EDT 2025

Powered by FUDForum. Page generated in 0.08308 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top