Skip to content

nikolay-martynov/eip-for-plantuml

Repository files navigation

EIP sprites for PlantUML

This is inspired by unofficial PlantUML EIP library by aheil https://github.com/aheil/EIP-PlantUML

The difference is that it was kind of small in terms of number of shapes and very buggy. Mix of C#, bash and lack of build automation did not allow to effectively fix the problems.

Instead, this sprite library is based on Enterprise Integration Pattern Shapes for Gliffy https://github.com/comsysto/enterprise-integration-pattern-shapes-for-gliffy

It is a pure sprite library just as standard Cloudinsight PlantUML sprites library https://github.com/rabelenda/cicon-plantuml-sprites

The nice thing about sprite library vs macro/function library is that you have much more control over appearance when writing your diagram.

Usage

First of all, include sprite library into your diagram:

!includeurl https://raw.githubusercontent.com/nikolay-martynov/eip-for-plantuml/master/dist/eip-for-plantuml.puml

Instead of master head you can specify any tag existing on GutHub. You can also just download the file and add it to your project resources.

Once included, you can use any sprite from the library just as any other sprite. You can read about sprites here: http://plantuml.com/sprite

The following example mimics splitter diagram from https://www.enterpriseintegrationpatterns.com/patterns/messaging/Sequencer.html

example
@startuml
!includeurl https://raw.githubusercontent.com/nikolay-martynov/eip-for-plantuml/master/dist/eip-for-plantuml.puml
legend top
    You can use sprite
    anywhere you can use text.
    Rectangle content is most
    convenient.
endlegend
rectangle "<$EIP_MessageDouble>\nNew order" as newOrder
rectangle "<$EIP_Splitter>\nSplitter" as splitter
rectangle "<$EIP_MessageSingleGreen>\nOrder item 1" as item1
rectangle "<$EIP_MessageSingleOrange>\nOrder item 2" as item2
newOrder -> splitter
splitter -> item1
item1 -[hidden] item2
@enduml

All sprites come in multiple sizes determined by sprite name suffix:

Table 1. Sprite sizes
Suffix Size

Small

50

100

Large

200

sizes

List of sprites

You can find description of each pattern here: https://www.enterpriseintegrationpatterns.com/patterns/messaging

The following diagram shows all sprites available in the library (you can click the image to copy name of sprite you need):

all sprites

Building

The project uses PlantUML Gradle plugin to generate example images hosted on GitHub. This means you’ll need GraphViz to generate these images.

Due to issue with PlantUML Gradle plugin, you’ll have to run build twice:

./gradlew
./gradlew

This will generate dist/eip-for-plantuml.puml as well as images in generated-examples used for GitHub documentation. These have to be added/committed to git.

About

Library of EIP sprites for PlantUML

Resources

License

Stars

Watchers

Forks

Packages

No packages published