Error in EclipseCon2008 Tutorial [message #5683] |
Wed, 07 January 2009 19:07  |
Eclipse User |
|
|
|
Hello Antoine,
Thanks a lot for all your efforts!
In the EclipseCon2008 tutorial
http://wiki.eclipse.org/STP/BPMN_Component/EclipseCon2008 a drag & drop
TextAnnotation association was explained. I think one thing was forgotten
in the tutorial, namely, how to associate the bpmn element (e.g Task) with
a new (Bug)TextAnnotation by dragging an dropping the bug on it. A red
border means, it is not allowed to associate a bug to this elements, the
blur one allows it.
The code there explains ONLY how to create a new TextAnnotation:
BPMNVisual2ProcessGenerator generator = new BPMNVisual2ProcessGenerator();
TextAnnotation textA = generator.addTextAnnotation(null, bug.getSummary());
but NOT how to associate e.g. a Task with it. So after dropping the
TextAnnotation, no Association to the Task will be created. This must be
created manually. My questions are:
1- How to indicate/access the currently selected element (with the colored
border) during dragging/dropping? I couldn't access the selected element
in the method getDropCommand() in the subclass of AbstractViewDnDHandler!
2- For now border color during dragging/dropping is red, i.e. it is not
allowed to associate the bug TextAnnotation to a Task. How can I modify
the allowed/forbidden bpmn elements?
3- Finally, how can I associate the dropped TextAnnotation to the allowed
bpmn element? I couldn't find a way how to create an Association and
assign it to e.g. a Task?
Thanks a lot again.
/Sam
|
|
|
Re: Error in EclipseCon2008 Tutorial [message #5718 is a reply to message #5683] |
Thu, 08 January 2009 13:07  |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
BPMNbeginner wrote:
> Hello Antoine,
>
> Thanks a lot for all your efforts!
>
> In the EclipseCon2008 tutorial
> http://wiki.eclipse.org/STP/BPMN_Component/EclipseCon2008 a drag & drop
> TextAnnotation association was explained. I think one thing was
> forgotten in the tutorial, namely, how to associate the bpmn element
> (e.g Task) with a new (Bug)TextAnnotation by dragging an dropping the
> bug on it. A red border means, it is not allowed to associate a bug to
> this elements, the blur one allows it.
>
> The code there explains ONLY how to create a new TextAnnotation:
Actually, that's because that's all the code does, really.
>
> BPMNVisual2ProcessGenerator generator = new BPMNVisual2ProcessGenerator();
> TextAnnotation textA = generator.addTextAnnotation(null, bug.getSummary());
>
> but NOT how to associate e.g. a Task with it. So after dropping the
> TextAnnotation, no Association to the Task will be created. This must be
> created manually. My questions are:
>
> 1- How to indicate/access the currently selected element (with the
> colored border) during dragging/dropping? I couldn't access the selected
> element in the method getDropCommand() in the subclass of
> AbstractViewDnDHandler!
Well, you have the hovered part, right ? Then all you need to do is
hoverPart.resolveSemanticElement(); to get the semantic element.
> 2- For now border color during dragging/dropping is red, i.e. it is not
> allowed to associate the bug TextAnnotation to a Task. How can I modify
> the allowed/forbidden bpmn elements?
Just modify the isEnabled method. The super method just makes sure the
BPMN constraints for a text annotation are respected, ie a text
annotation may be dropped in a subprocess or a pool or a diagram. That's
why it cannot be dropped on a task.
> 3- Finally, how can I associate the dropped TextAnnotation to the
> allowed bpmn element? I couldn't find a way how to create an Association
> and assign it to e.g. a Task?
That's a different way to do things altogether.
When you do a drop, you add elements to the diagram. When you add an
association with an existing element of the diagram, you modify the
existing diagram.
So it is a different generator you would need to use,
BPMNVisualProcessGenerator, associated with the current diagram. Or you
can create elements by using requests.
You will need to make the modifications inside a command, that you would
return at the end.
>
> Thanks a lot again.
>
> /Sam
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03296 seconds