Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MDT (Model Development Tools) » [bpmn2] Convert Expression to FormalExpression
[bpmn2] Convert Expression to FormalExpression [message #667591] Fri, 29 April 2011 18:40 Go to next message
tsurdilo  is currently offline tsurdilo Friend
Messages: 41
Registered: February 2011
Member
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 07:43 Go to previous message
Henning Heitkoetter is currently offline Henning HeitkoetterFriend
Messages: 21
Registered: April 2010
Junior Member
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: Sat Apr 27 04:39:11 GMT 2024

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

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

Back to the top