Using XPATH expressions to set elements of a dataObject

瀏覽次數:23 次
跳到第一則未讀訊息

Farrukh Najmi

未讀,
2010年9月24日 下午1:55:412010/9/24
收件者:BPMN Users Group

All the data in my BPMN2 process is XML data corresponding to a
specific xsd. I assume therefor that XPATH is the natural choice for
my expression language.

I cannot seem to figure out how to use XPATH to assign multiple
elements to a dataInput. Here are the specifics...

In my XSD file I have:

<complexType name="EmailMessageType">
<sequence>
<element name="to" type="string" minOccurs="0"
maxOccurs="unbounded"/>
<element name="replyTo" type="string" minOccurs="0"
maxOccurs="1"/>
<element name="message" type="string" minOccurs="1"
maxOccurs="1"/>
</sequence>
<attribute name="subject" type="string" use="required"/>
</extension>
</complexType>
<element name ="EmailMessage" type="EmailMessageType"/>

In my bpmn2 file, I have imported the xsd file and mapped its target
namespace to prefix "rim:".

In my bpmn2 file I want to have a sendTask whose dataInput is of type
EmailMessageType and I want to setup all the <to> sub-elements of the
EmailMessageType using literal constants.

Does the following look like the correct way to use assignment to use
literal constants to assign multiple <to> sub-elements to the
dataInput?

<itemDefinition id="emailMessageItemDefinition" isCollection="false"
itemKind="Information"
structureRef="rim:EmailMessageType" / ...>

<process>
<sendTask ...>
<dataInputAssociation>
<targetRef>EmailMessageDataInputOfSendTask</targetRef>
<assignment>
<from>far...@address1.com</from>
<to>${getDataInput("EmailMessageDataInputOfSendTask")}/to</
to>
</assignment>
<assignment>
<from>far...@address2.com</from>
<to>${getDataInput("EmailMessageDataInputOfSendTask")}/to</
to>
</assignment>
</dataInputAssociation>
</sendTask>
</process>
</process>

Also, I am not clear on when and how to use ${} around the
getDataInput and other functions. I am finding the spec to be quite
difficult to follow in this area and that of section "10.3 Items and
Data" in general.

I have ordered Bruce's book and hope that it will help clear some of
the mystery:

http://www.amazon.com/gp/product/0982368100/ref=oss_product

In the meantime, any help would be greatly appreciated. Thanks.
回覆所有人
回覆作者
轉寄
0 則新訊息