I have a class and a sequence diagram: _view_class.puml and _view_seq.puml in https://github.com/zimtkeks/zimtkeks.github.io/tree/master/static/2019-03-08-plantuml-diagrams-without-redundancy (as ZIP)
I'm trying to convert them to preprocessorV2, so I added !preprocessorV2 to a _common.iuml, that is included in both diagrams, see this branch: https://github.com/zimtkeks/zimtkeks.github.io/tree/plantuml-preprocessor-V2/static/2019-03-08-plantuml-diagrams-without-redundancy (as ZIP)
However, I get a !preprocessorV2 syntax error with V1.2019.5, maybe because it occurs multiple times. Is that an issue in plantuml or should I take care that multiple inclusions don't happen in my diagrams (by avoiding !include_many or by using include-guards as with the C preprocessor)?
This is the generated PlantUML (from the SVG comment):
@startuml
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
left header
Created by @StefanDensow for PlantUML illustration.
endheader
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
class Concierge {
Gets a tip from a ""Tourist"", seats
him/her into a taxi and sends it to
one of the top 10 sights in the area.
..
+ init()
+ run() <color:blue>**ASYNC**</color>
+ add(Tourist)
..
- TaxiManager mTaxiManager
- List<Location> mTop10Sights
- <&lock-locked> List<Tourist> mGuests
}
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
class Tourist {
+ int payCash(amount)
..
- int mCashAmount
}
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
class Taxi {
Takes a ""Tourist"" to a given location,
gets a fee before dropoff.
Calls ""onAvailable()"" when
tourist has been dropped off.
- -
+ enter(Tourist)
+ goTo(Location) <color:blue>**ASYNC**</color>
..
- dropOff(Tourist)
- Tourist mTourist
- ITaxiListener mListener
}
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
interface ITaxiListener #tan {
- onAvailable(Taxi)
- signOff(Taxi)
}
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
class TaxiManager <<abstract>> {
""getNewInstance()"" randomly selects
a concrete ""TaxiManager"" child for
instantiation to maintain fairness
between the cab companies.
..
+ {static} TaxiManager getNewInstance()
+ {abstract} Optional<Taxi> requestTaxi()
.. ITaxiListener ..
+ {abstract} onAvailable(Taxi)
..
# List<Taxi> mAvailableTaxis
# List<Taxi> mOccupiedTaxis
# <&lock-locked> mTaxiLock
}
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
class InstaCab {
//<Insert catchy slogan here>//
.. TaxiManager ..
+ Optional<Taxi> requestTaxi()
.. ITaxiListener ..
+ onAvailable(Taxi)
}
!preprocessorV2
skinparam DefaultMonospacedFontName Menlo
hide empty members
class SpeedyCab {
//We put the pedal to the metal!//
.. TaxiManager ..
+ Optional<Taxi> requestTaxi()
.. ITaxiListener ..
+ onAvailable(Taxi)
}
Concierge o..> Taxi: calls >
Concierge "1" o- -> "1" TaxiManager: calls >
Concierge o- -> Tourist: gets tip\nfrom >
Taxi <- -* TaxiManager: owns <
Taxi o-> Tourist: gets fee\nfrom >
Taxi o-[#tan]l-> ITaxiListener: calls >
ITaxiListener <-[#tan]-+ TaxiManager: provides\nimplementation <
TaxiManager <|- - InstaCab
TaxiManager <|- - SpeedyCab
@enduml
PlantUML version 1.2019.05(Sat Apr 20 18:45:36 CEST 2019)