Or if you are totally sure your names will always start with "ControlFlow", you might do something like

sortedBy(oclAsType(ControlFlow).name.substring('ControlFlow'.size() + 1).toInteger())

As OCL understands that the order is number ordering and not alphabetical ordering if you give him integers. If you are unsure whether your names always start by "ControlFlow" yet are sure that they all end in numbers, you can use something like that instead :

sortedBy(oclAsType(ControlFlow).name.replace('.*?(\\d+)', '$1').toInteger())

This is somewhat convoluted, but I believe it is the easiest way of achieving your need.

Laurent Goubet
Obeo

Topcased user list where issues are discussed wrote:
Hi Dominik,

The order we suggest was an alphabetic order, so ControlFlow10 is before ControlFlow2. In order to have your elements ordered more specifically, you will have to create your own Orderer. Gendoc2 allows you to call Java methods from Acceleo scripts inside Gendoc2 templates . A dedicated tutorial for the creation of such "external bundles" is present in section Gendoc2 -> Tutorial -> External Bundle tutorial of the following page : http://gforge.enseeiht.fr/docman/?group_id=102

You can create Java code for your specific orderer, and then this tutorial will show you how to create an external bundle plugin, containing an Acceleo query that calls your Java method.

Regards,
Anne

Topcased user list where issues are discussed a écrit :

Hi Anne, Hi Laurent,

I'm hoping, thats the right List to ask, but as it's a follow up to the original question I'm posting this here.

I have now used ocl statements insinde the for-statement. The only problem is this:

after ordering my List looks like this:

ControlFlow1
ControlFlow10
ControlFlow11
ControlFlow12
ControlFlow2
ControlFlow3
...

So the ordering of the items is OK but not really right, same old Problem with EXCEL if you dont tell it to sort everything that looks like a number like a number.

I'm at a total loss here, because it seems to me, that this issue requires some tinkering with the code, but if it's ACCELEO or GENDOC2 I quite don't know. Can anyone help solving such an issue, maybe something allready planned, or never seen before??

I appreciate all of your help

Regards

Dominik


Inaktiv: Details verbergen für Topcased user list where issues are discussed <[email protected]>Topcased user list where issues are discussed <[email protected]>


                        *Topcased user list where issues are
                        discussed <[email protected]>*
                        Gesendet von:
                        [email protected]

                        21.05.2010 09:25
                        Bitte antworten an
                        [email protected]

        

An
        
[email protected]

Kopie
        
[email protected]

Thema
        
Re: [Topcased-users] Antwort: Re: Antwort: Re: Gendoc 2 and Requirements

        


Hi Dominik, Anne,

I don't know which Acceleo version is in use here, but this expression
can be simplified to:

[for
(c.ownedElement->select(oclIsKindOf(ControlFlow))->sortedBy(oclAsType(ControlFlow).name))]

in all versions (inside the for, you'll access the variable through
"self" instead of "cf" with this), and you can further simplify it to

[for (c.ownedElement->filter(ControlFlow)->sortedBy(name))]

in the 3.0 version since 3.0M6 which was released last month... Might
not be relevant here, but I wanted to at least let you know we're trying
to simplify these.

Also, take note that UML doesn't have any "ordered" feature. Whatever
reference you're following (ownedElements, edges, variables, ...) the
metamodel specifies a non-ordered reference. As mentionned Anne, you'll
have to reorder it yourself through the OCL "sortedBy" operation.

Laurent Goubet
Obeo

Topcased user list where issues are discussed wrote:
> Hi Dominik,
>
> Actually the order you see in the outline is not preserved when gendoc
> retrieves the list of control flows of an activity.
> If you need a specific order, you can use OCL syntax :
> [for (cf:ControlFlow
> |c.ownedElement->select(a|a.oclIsKindOf(ControlFlow))->sortedBy(e:
> Element | e.oclAsType(ControlFlow).name))]
> ...
> [/for]
>
>  *->select(a|a.oclIsKindOf(ControlFlow))* allows you to select only
> ControlFlows from the list of ownedElement
> * ->sortedBy(e: Element | e.oclAsType(ControlFlow).name)* sorts the
> list of controlFlows by their name
>
> Regards,
> Anne
>
> Topcased user list where issues are discussed a écrit :
>>
>> Hi Caroline,
>>
>> Thanks for the Reply, I'm looking forward to the update. Thank you
>> for your time and effort.
>>
>> Another question occured to me while writing other GenDoc2 scripts. I
>> have a Model like this:
>>
>> - Package
>> - - Activity
>> - - - ControlFlow1
>> - - - ControlFlow2
>>
>> But the GenDoc2 output is like this
>>
>> - Package
>> - - Activity
>> - - - ControlFlow2
>> - - - ControlFlow1
>> How can I get the order from my Model to appear in the documentation.
>>
>> This is the code I'm using:
>>
>> <context model='${model}' element='${first_Package}/Ablauf/Ablauf'
>> importedBundles='topcased'/><gendoc>[for(cf:ControlFlow|self.ownedElement)]
>>
>>
>> */[cf.source.name/] --> [cf.target.name/]/*
>>
>>             [cf.getDocumentation()/]
>>
>> *[cf.source.name/]*
>>
>> [cf.source.getDocumentation()/]
>>
>> *[cf.target.name/]*
>>
>> [cf.target.getDocumentation()/]
>>
>> [/for]</gendoc>
>>
>>
>>
>> The bold lines are Headings
>>
>> Thanks again for your time and effort
>>
>> Regards
>>
>>
>> Dominik
>>
>>
>> Inaktiv: Details verbergen für Topcased user list where issues are
>> discussed <[email protected]>Topcased user list where
>> issues are discussed <[email protected]>
>>
>>
>>                         *Topcased user list where issues are
>>                         discussed <[email protected]>*
>>                         Gesendet von:
>>                         [email protected]
>>
>>                         17.05.2010 11:43
>>                         Bitte antworten an
>>                         [email protected]
>>
>>
>>
>> An
>>
>> [email protected]
>>
>> Kopie
>>
>> [email protected]
>>
>> Thema
>>
>> Re: [Topcased-users] Antwort: Re: Gendoc 2 and Requirements
>>
>>
>>
>>
>> Hi Dominik,
>>
>> This is actually a bug. We are working on it and it will be fixed on
>> next gendoc version.
>>
>> Sorry for the inconvenience.
>>
>> Best regards,
>> Caroline
>>
>> Topcased user list where issues are discussed a écrit :
>>
>>             Hi Anne,
>>
>>             have you had time to look into my problem?? have you
>>             found anything?? My Problem still exists, I can't get my
>>             Requirements to show up in my GenDoc2 Documentation. I
>>             have also tried to cast the return value of
>>             getrequirementList() to CurrentRequirement like this:
>>
>>             [for(r:CurrentRequirement | uc.getRequirementList())]
>>             [r.getDocumentation()/][/for]
>>
>>             but there were no Requirements either.
>>
>>             I hope you can help my solve this issue
>>
>>             Regards
>>
>>
>>             Dominik
>>
>>
>>             Inaktiv: Details verbergen für
>> [email protected][email protected]_
>>             <mailto:[email protected]>
>>
>> *[email protected]_* >> <mailto:[email protected]>
>>
>>                                                             Gesendet
>>                                                             von:
>> [email protected]_ >> <mailto:[email protected]>
>>
>>
>>                                                             05.05.2010
>>                                                             09:24
>>
>>             Bitte antworten an_
>>             [email protected]_
>>             <mailto:[email protected]>
>>
>> >> An
>>             _
>>             [email protected]_
>>             <mailto:[email protected]>
>>             Kopie
>>             _
>>             [email protected]_
>>             <mailto:[email protected]>
>>             Thema
>> >> Re: [Topcased-users] Gendoc 2 and Requirements
>>
>> >>
>>
>>             Hi Dominik,
>>
>>             Your script seems ok. We will look at this today.
>>
>>             Regards
>>             Anne_
>>             __
>>             [email protected]_
>>             <mailto:[email protected]> a écrit :
>>                                     Hi @ all,
>>
>>                                     I'm trying a second desperate
>>                                     attempt, as I'm still not any
>>                                     further to solving the problem.
>>                                     I'm having quite a dificult time
>>                                     extracting the Requirements from
>>                                     a UseCase with the Help of Gendoc
>>                                     2. All attempts though no error
>>                                     during creation have failed to
>> give me anything of my Requirements.
>>
>>                                     Here once again my code:
>>
>>                                     */UseCases/*/ /
>>
>>                                     /<context model=’${model}’
>>                                     element='Test’
>> importedBundles='topcased;requirement'/>
>>                                     /
>>
>>                                     /<gendoc> /
>>
>> /[for(uc:UseCase|self.ownedElement)]/
>>
>>
>>                                     */[uc.name/] /*
>>
>> /[for(a:Activity|uc.ownedElement)]<image
>>                                     object='[a.getDiagram()/]'
>>                                     keepW='true'> /
>>
>>                                     /</image> [/for] /
>>
>>                                     /[uc.getDocumentation()/] /
>>
>> /[for(r:Requirement|uc.getRequirementList())]
>>                                     /
>>
>>                                     /[r.getDocumentation()/] /
>>
>>                                     /[/for] /
>>
>>                                     /[/for] /
>>
>>                                     /</gendoc>/
>>
>>                                     All the bolds are Headings. And
>>                                     between the image tags there is
>>                                     an empty canvas. My Problem is,
>>                                     that there's no Text of a
>>                                     requirement shown in the created
>>                                     Document, although UseCases have
>>                                     been linked to requirements (or
>>                                     the other way round as it is :-D
>>                                     ). How can I extract these
>>                                     Requirements to show them in my
>>                                     Document??
>>
>>                                     I'm really hoping someone can
>>                                     help me with this problem
>>
>>                                     regards
>>
>>                                     Dominik Schmid
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>>                                     Topcased-users mailing list_
>> [email protected]_ >> <mailto:[email protected]>_ >> __http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users_
>>
>>             --
>>
>> >>
>> <http://www.atosorigin.fr/> *Anne HAUGOMMARD**
>> Atos Origin Intégration *
>> Téléphone : +33 (0)5 34 36 34 46
>> Mail : [email protected]_
>> <mailto:[email protected]>
>> Fax : +33 (0) 5 34 36 31 00
>>
>> *Développement durable, anticipons pour notre avenir /
>> Sustainability, advance our future
>> N'imprimez ce mail que si nécessaire / please consider your
>> environmental responsibility before printing this e-mail.*
>> Ce message et les pièces jointes sont confidentiels et réservés à
>> l'usage exclusif de ses destinataires. Il peut également être protégé
>> par le secret professionnel. Si vous recevez ce message par erreur,
>> merci d'en avertir immédiatement l'expéditeur et de le détruire.
>> L'intégrité du message ne pouvant être assurée sur Internet, la
>> responsabilité du groupe Atos Origin ne pourra être recherchée quant
>> au contenu de ce message. Bien que les meilleurs efforts soient faits
>> pour maintenir cette transmission exempte de tout virus, l'expéditeur
>> ne donne aucune garantie à cet égard et sa responsabilité ne saurait
>> être recherchée pour tout dommage résultant d'un virus transmis.
>>
>> This e-mail and the documents attached are confidential and intended
>> solely for the addressee; it may also be privileged. If you receive
>> this e-mail in error, please notify the sender immediately and
>> destroy it. As its integrity cannot be secured on the Internet, the
>> Atos Origin group liability cannot be triggered for the message
>> content. Although the sender endeavours to maintain a computer
>> virus-free network, the sender does not warrant that this
>> transmission is virus-free and will not be liable for any damages
>> resulting from any virus transmitted.
>>
>>             _______________________________________________
>>             Topcased-users mailing list_
>>             [email protected]_
>>             <mailto:[email protected]>_
>> __http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users_
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>             _______________________________________________
>>             Topcased-users mailing list
>>             [email protected]_
>>             <mailto:[email protected]>
>> _http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users_
>>
>>
>>
>> --
>> *Caroline Bourdeu d'Aguerre**
>> Atos Origin*
>> Tel : 05 34 36 32 90_
>> __www.atosorigin.fr_ <http://www.atosorigin.fr/>
>>
>> *Développement durable, anticipons pour notre avenir /
>> Sustainibility, advance our future**
>> P** N'imprimez ce mail que si nécessaire / please consider your
>> environmental responsibility before printing this e-mail.*
>> Ce message et les pièces jointes sont confidentiels et réservés à
>> l'usage exclusif de ses destinataires. Il peut également être protégé
>> par le secret professionnel. Si vous recevez ce message par erreur,
>> merci d'en avertir immédiatement l'expéditeur et de le détruire.
>> L'intégrité du message ne pouvant être assurée sur Internet, la
>> responsabilité du groupe Atos Origin ne pourra être recherchée quant
>> au contenu de ce message. Bien que les meilleurs efforts soient faits
>> pour maintenir cette transmission exempte de tout virus, l'expéditeur
>> ne donne aucune garantie à cet égard et sa responsabilité ne saurait
>> être recherchée pour tout dommage résultant d'un virus transmis.
>>
>> This e-mail and the documents attached are confidential and intended
>> solely for the addressee; it may also be privileged. If you receive
>> this e-mail in error, please notify the sender immediately and
>> destroy it. As its integrity cannot be secured on the Internet, the
>> Atos Origin group liability cannot be triggered for the message
>> content. Although the sender endeavours to maintain a computer
>> virus-free network, the sender does not warrant that this
>> transmission is virus-free and will not be liable for any damages
>> resulting from any virus transmitted.
>>
>> _______________________________________________
>> Topcased-users mailing list
>> [email protected]
>> http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Topcased-users mailing list
>> [email protected]
>> http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users
>
> --
>
> >
> <http://www.atosorigin.fr> * Anne HAUGOMMARD*
> * Atos Origin Intégration *
> Téléphone : +33 (0)5 34 36 34 46
> Mail : [email protected]
> <mailto:[email protected]>
> Fax : +33 (0) 5 34 36 31 00
>
> Développement durable, anticipons pour notre avenir / Sustainability,
> advance our future
> N'imprimez ce mail que si nécessaire / please consider your
> environmental responsibility before printing this e-mail.
> Ce message et les pièces jointes sont confidentiels et réservés à
> l'usage exclusif de ses destinataires. Il peut également être protégé
> par le secret professionnel. Si vous recevez ce message par erreur,
> merci d'en avertir immédiatement l'expéditeur et de le détruire.
> L'intégrité du message ne pouvant être assurée sur Internet, la
> responsabilité du groupe Atos Origin ne pourra être recherchée quant
> au contenu de ce message. Bien que les meilleurs efforts soient faits
> pour maintenir cette transmission exempte de tout virus, l'expéditeur
> ne donne aucune garantie à cet égard et sa responsabilité ne saurait
> être recherchée pour tout dommage résultant d'un virus transmis.
>
> This e-mail and the documents attached are confidential and intended
> solely for the addressee; it may also be privileged. If you receive
> this e-mail in error, please notify the sender immediately and destroy
> it. As its integrity cannot be secured on the Internet, the Atos
> Origin group liability cannot be triggered for the message content.
> Although the sender endeavours to maintain a computer virus-free
> network, the sender does not warrant that this transmission is
> virus-free and will not be liable for any damages resulting from any
> virus transmitted.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Topcased-users mailing list
> [email protected]
> http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

/(Siehe angehängte Datei: laurent_goubet.vcf)/_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

------------------------------------------------------------------------

_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

--

<http://www.atosorigin.fr>        * Anne HAUGOMMARD*
* Atos Origin Intégration *
Téléphone : +33 (0)5 34 36 34 46
Mail : [email protected] <mailto:[email protected]>
Fax : +33 (0) 5 34 36 31 00

Développement durable, anticipons pour notre avenir / Sustainability, advance our future N'imprimez ce mail que si nécessaire / please consider your environmental responsibility before printing this e-mail. Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

------------------------------------------------------------------------

_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

<<attachment: laurent_goubet.vcf>>

_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

Reply via email to