PLantuml !procedure examples using 1.2021.14 version throwing parsing errors but works with !definelong

0 votes
asked Jan 7, 2022 in Question / help by anonymous

Hi Using plantuml 1.2021.14 with !procedure throwing errors. Can someone please let me know whats the issue with below plantuml code. This works with !definelong instead of !procedure

@startuml
!procedure $ALICEPART($a)
  participant $a #white
!endprocedure

!define part_alice $ALICEPART(test)

part_alice
@enduml

1 Answer

0 votes
answered Jan 7, 2022 by The-Lu (64,340 points)

Hello A.,

In fact, in order to make an affectation (on part_alice), we must to use `function`, as:

@startuml
!function $ALICEPART($a) return "participant " + $a + " #white"

!part_alice = $ALICEPART(test)

part_alice
@enduml

If that can help,
Regards,
Th.

commented Jan 7, 2022 by The-Lu (64,340 points)

Or using only procedure, as:

@startuml
!procedure $ALICEPART($a)
  participant $a #white
!endprocedure

!procedure part_alice()
 $ALICEPART(test)
!endprocedure

part_alice()
@enduml

Regards,
Th.

commented Jan 12, 2022 by anonymous

Hi,

Thank you very much.

 One quick question:
!define and !definelong are  working for plantuml 1.2021.14 currently right?. Here I need compatibility with even 1.2020.02 version also.

It was mention platuml.com migration notes that:
Even if some legacy features are still supported with the actual preprocessor, you should not use them any more (they might be removed in some long term future).

Does it mean the support will be removed in next coming releases or for existing 1.2021.14?

commented Jan 13, 2022 by anonymous
HI thanks. Actually I posted that question.
...