Importing procedures and functions

0 votes
asked Sep 30, 2020 in Question / help by carathorys

Hi!

Is there a way, to collect procedures and functions in a standalone file, and import them in other files?

I'm trying to achieve this, because I've written some functions to generate docs, collected these functions to a separated file, and imported to the ones, where I would like to use these functions.

The result is just Syntax Error ? error message.

Thanks for your help!

Regards,

carathorys

1 Answer

0 votes
answered Oct 1, 2020 by plantuml (295,000 points)

Yes!

Here is a basic example:

File a.puml:

@startuml
!procedure $msg($source, $destination)
  $source --> $destination
!endprocedure
@enduml


File b.puml:

@startuml
' Import the procedure "msg"
!include a.puml

$msg("foo1", "foo2")
@enduml


It should work fine.
Tell us if you find issues!

...