[New Activity] removing leading spaces in an activity description.

+1 vote
asked Oct 8, 2013 in To be sorted by Hiroki Tsukahara (160 points)

I want to use indentation for activity diagram like that..

if ( some condition ) then (yes)

: Process #1

operation something .... ;

endif

If we remove leading spaces at each line of activity description, it is useful, I think.

what do you think ?

 

1 Answer

0 votes
answered Oct 8, 2013 by plantuml (295,000 points)

Yes, it's a good idea.

You can use tabulation before each operation. For example:

http://www.plantuml.com/plantuml/form?url=oqnJq50epizDLKZEpql9BCdCprFGL2Z9ICrJqAXCBTRaiWeeoazEBIvMK3RauimlI2rA1Ajn16igoSZCIrVG0m9aEITqERWHHiZAdD6KMNEb0bsG1W00

if ( some condition ) then (yes)
:Process #1
    operation A something ....
    operation B something ....
Process #2
    operation C something ....;
endif

 

 

Is this what you are looking for ?

commented Nov 4, 2013 by byronwatt (100 points)
edited Nov 4, 2013 by byronwatt
I am having the same problem.

Nested if statements and multi-line operations adds extra unwanted whitespace.

For example, I would like to type:

if ( some condition ) then (yes)
    : condition1
    ...
    operation A something ....;
    if (condition2) then (yes)
        := condition2
        ...
        operation B something ....;
        if (condition3) then (yes)
            := condition3
            ...
            operation C something ....;
        endif
    endif
endif

but this produces:

http://www.plantuml.com/plantuml/img/SoWkIImgAStDuUNYvSfCKz1GACxFJLL8pizBoIp9pCzJq5GeoKZDKz2eJ2tMvELI008hXAmXH4HFJm_2o2z8BKe4QtC4crEIaPcN3fBMiuOe0Da0rss4QJROV5k41KO8ORWbg1OvORS8mp9Zx9QXMsYCAeLYAQh5phWjJWKQbWRXGfbGYfVB0SY2XZO0

but what I would like to see is:

http://www.plantuml.com/plantuml/img/SoWkIImgAStDuUNYvSfCKz1GACxFJLL8pizBoIp9pCzJq5GeoKZDKz2eJ2tMvELI008hXAmXBvUUdXulLtv1Qb4YMBaZM7z9HcPUkW9GIiyQeWTaCboN4QQPO7Dj4GOROHZiXDrW3CEDiHkERe4nXWNEk2r81MfAWt2XJ2Z5o-K0P4533m00

Awesome program BTW,... every time I don't have to use visio it makes me smile.
commented Nov 4, 2013 by plantuml (295,000 points)
Ok, I've got your point.

You can test here a beta version that should work as expected:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Note that the trailing space before : are important.
If you put additionnal space in the text body (like in condition3), the text will be indented.
It sound logical, what do you think about it ?

Example:

@startuml
if ( some condition ) then (yes)
    :=condition1
    ...
    operation A something ....;
    if (condition2) then (yes)
        := condition2
        ...
        operation B something ....;
        if (condition3) then (yes)
            := condition3
              ...
              operation C something ....;
        endif
    endif
endif
@enduml
commented Nov 4, 2013 by byronwatt (100 points)
Perfect, Thanks!
...