id uniqueness in a BPMN 2.0 document

116 views
Skip to first unread message

Rice

unread,
Aug 18, 2011, 11:56:45 PM8/18/11
to BPMN Forum
Hi,
All BaseElement in BPMN have an id attribute. Must it be unique
within the document? This seems to be XML spec's requirement, right?
However, the buyer process example in BPMN 2.0 spec (page 171) breaks
this rule as shown below. There are 2 buyerName ids. Is it intended or
just a bug?

<resource id="regionalManager" name="Regional Manager">
<resourceParameter id="buyerName" isRequired="true" name="Buyer Name"
type="xsd:string"/>
<resourceParameter id="region" isRequired="false" name="Region"
type="xsd:string"/>
</resource>
<resource id="departmentalReviewer" name="Departmental Reviewer">
<resourceParameter id="buyerName" isRequired="true" name="Buyer Name"
type="xsd:string"/>
</resource>

Rice

Neal McWhorter

unread,
Aug 19, 2011, 6:59:02 PM8/19/11
to bpmn...@googlegroups.com
Rice,

I think you've misinterpreted the id attribute of BaseElement. The spec says:

id: string 
This attribute is used to uniquely identify BPMN elements. The id is
REQUIRED if this element is referenced or intended to be referenced by
something else. If the element is not currently referenced and is never intended
to be referenced, the id MAY be omitted

So not only is there no guarantee of uniqueness, there isn't any guarantee that it will even be set. There IS an implied guarantee that any id that is REFERENCED must be unique or else execution would be impossible because it wouldn't be possible to resolve between multiple elements with the same id. The idea here was to not require unique ids for things that were never referenced by id. I think it would have been better if the spec guaranteed uniqueness if the id was set and then made the id optional, but it doesn't.  I would suggest that doing this is a best practice from an XML generation standpoint.

In the example that you cite, setting the attribute is definitely optional and in fact serves no real purpose so I wouldn't expect the id attribute to be set but it isn't an error to set it and for it to be non-unique.

Business Vision Delivered

Neal McWhorter
Principal

neal.mc...@enterprise-agility.com
www.Enterprise-Agility.com

Enterprise Agility, Inc.
1543 N. Milwaukee Ave.
Chicago, IL 60622

Tel:   773-227-7110

 

 

--
You received this message because you are subscribed to the Google
Groups "BPMN Forum" group.
Public website: http://www.bpmnforum.com
To post to this group, send email to BPMN...@googlegroups.com
To unsubscribe from this group, send email to
BPMNforum+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/BPMNforum?hl=en_US?hl=en

Rice

unread,
Aug 20, 2011, 11:28:59 AM8/20/11
to BPMN Forum
Hi Neal,
If the id uniqueness is not guaranteed, the attribute 'id' in
BaseElement should not be defined to be with type 'xsd:ID', which has
the meaning "The purpose of the xs:ID datatype is to define unique
identifiers that are global to a document".

Rice

On Aug 20, 6:59 am, Neal McWhorter <neal.mcwhor...@gmail.com> wrote:
> Rice,
>
> I think you've misinterpreted the id attribute of BaseElement. The spec
> says:
>
> id: string
> This attribute is used to uniquely identify BPMN elements. The id is
> REQUIRED if this element is referenced or intended to be referenced by
> something else. If the element is not currently referenced and is never
> intended
> to be referenced, the id MAY be omitted
>
> So not only is there no guarantee of uniqueness, there isn't any guarantee
> that it will even be set. There IS an implied guarantee that any id that is
> REFERENCED must be unique or else execution would be impossible because it
> wouldn't be possible to resolve between multiple elements with the same id.
> The idea here was to not require unique ids for things that were never
> referenced by id. I think it would have been better if the spec guaranteed
> uniqueness if the id was set and then made the id optional, but it doesn't.
>  I would suggest that doing this is a best practice from an XML generation
> standpoint.
>
> In the example that you cite, setting the attribute is definitely optional
> and in fact serves no real purpose so I wouldn't expect the id attribute to
> be set but it isn't an error to set it and for it to be non-unique.
>
>  *Business Vision Delivered*
>
> *Neal McWhorter*
> *Principal*
>
> neal.mcwhor...@enterprise-agility.comwww.Enterprise-Agility.com<http://www.enterprise-agility.com/>
>
> *Enterprise Agility, Inc.*
> 1543 N. Milwaukee Ave.
> Chicago, IL 60622
>
> Tel:   773-227-7110
>

Neal McWhorter

unread,
Aug 21, 2011, 3:37:43 PM8/21/11
to bpmn...@googlegroups.com
Rice,

"Purpose" is different than "requirement" I'm afraid. So there is no guarantee made. Any element in BPMN that is addressed by "id" will have to be globally unique within the document so the usage aligns with this "purpose".

In any case, the BPMN standard allows this.

Business Vision Delivered

Enterprise Agility, Inc.

Tel:   773-227-7110

 

 

Reply all
Reply to author
Forward
0 new messages