PlantUML ... Quick Question


#1

PlantUML … Quick Question… Is there a way to export a sequence diagram so that it can be read by plantUML ?

plantUML is a text based program that my client uses. I’m not having any luck. Tried to export as a XMI but how do I then import it into plantUML.

Funnily enough, I can convert easily the other way from plantUML format to VP with the “import from websequencediagrams”

Any ideas?

Rob


#2

Visual Paradigm support only the standard XMI for exchanging (import + export) UML. However, PlantUML seems doesn’t support the import of standard UML XMI. Perhaps, your could implement a Visual Paradigm plugin for serving such a purpose. (i.e it can read a sequence diagram and export the logic into textual format.
If you don’t know how to implement a VP’s plugin, I would suggest you to use the following work-around solution:
Using DocComposer + Customized Template XML for exporting to PlantUML, please read the attached image as shown as following:


Follow the 4 steps as shown in the Figure above, can generate a simple sequence diagram in Textual format.
And then you can modify the Template XML to handle more other cases for the PlantUML,
e.g. check the ‘actionType’ to generate different messages in text: ->, -->, ->>, etc…
Hope this solution can help you.
If you want to implement the plugin or have any further questions, please feel free to contract me again

-------------------- Template XML (for simple sequence diagram) -----------------

<?xml version="1.0" encoding="UTF-8"?>
<Text style="@heading+">Messages in Text</Text>
<ParagraphBreak/>

<HasChildElementChecker modelType="Message">
	
	
	<IterationBlock modelType="Message" sortBy="property" sortProperty="y">
	
		<FromEnd>
			<Property property="name"/>
		</FromEnd>
		
		<ValueChecker property="actionType" value="Return" operator="equals">
			<Text> --&gt; </Text>
		</ValueChecker>
		<ValueChecker property="actionType" value="Return" operator="not equals">
			<Text> -&gt; </Text>
		</ValueChecker>
		
		<ToEnd>
			<Property property="name"/>
		</ToEnd>
		
		<Text> : </Text>
		<Property property="name"/>
		
		<ParagraphBreak/>
		
	</IterationBlock>
</HasChildElementChecker>