Reseting BizAgi Formating Options

Hi,

I have a person who is collaborating with me on the modeling of a complex project. This person prefers to use BizAgi. We are consolidating the overall system modeling on VP.

Here’s the question:

  • the default formatting of VP is significantly different from BizAgi. Is there a way to reset BizAgi formating to VP’s formatting with a click of a button?

Thanks for the help! :+1::grinning:

Interesting question… At first I thought you were asking about B.A. but then I realized what you’re trying to do :wink:

The quickest way that I know off is the format copier. Check the Diagram tab, there you’ll find both the ‘Format’ and ‘Format Copier’ options. It could be a little tedious I suppose, but still quick enough I hope.

Lets start with the tasks… Double click, and add a default VP task element. That will be formatted using the default properties (yellow and such). Now; while you have the task element selected double click on the format copier. Then click on one of the B.A. task elements and you’ll effectively copy the original format over. And because you double clicked the option remains active. So all you have to do is click / select each of the other tasks once.

After you’re done you can basically expand this for the other elements. Though I just did a little test and it seems that a task and manual task use the same formatting, so you’re good there. I guess the main elements to change are:

  • Tasks + derivatives (manual task, user task, service task, etc.)
  • Event elements (start, intermediate, stop)
  • Gateways / decision nodes

I suppose the same applies to lanes as well.

Still, there should be an even easier way (well, sorta). I wonder how difficult it will be to write a plugin for this. Seems trivial enough. No promises, but I’ll probably fire up NetBeans and have a look see.

Hey ShelLuser.

Thanks for the short cut.

I will try that.

If someone decides to upgrade/develop a plug-in I would love to know more about it.

Thanks, Filipe

It’s going to take me a little while but I am definitely making some progress :slight_smile: The foundation for my plugin is ready:

    @Override
    public void performAction(VPAction arg0) {
        IDiagramUIModel currentDiagram = ApplicationManager.instance().getDiagramManager().getActiveDiagram();
        IDiagramElement[] diagramElements = currentDiagram.toDiagramElementArray();
        for (IDiagramElement ide : diagramElements) {
            System.out.println(ide.getModelElement().getName());
        }
    }

And what do you know:

[2017/09/19 11:10:23] [message] FormatReset plugin is succesfully loaded!
[2017/09/19 11:13:22] [message] Begin
[2017/09/19 11:13:22] [message] Lets test
[2017/09/19 11:13:22] [message] null
[2017/09/19 11:13:22] [message] The End
[2017/09/19 11:13:22] [message] null

In case you’re wondering, I let it iterate over this here:

Business Process Diagram1

So yeah, progress…

Now for the hard part: separating the right elements, then somehow checking their property / formatting and then checking if (and how) I can reset that to default. Worse case scenario is that I’ll have to apply manual formatting (so copying the original), but it’s too early to tell.

I’ve had some minor hands on experience with VP plugins before, but interacting with model elements like this is a little new to me (which is what makes it fun).

I’ll keep you posted!

1 Like

Impressive stuff!!!

Awesome.

Thanks :grinning::+1:

Small update… I expect the plugin to be ready tomorrow, at most upcoming Friday.

At first I made the (classic?) mistake of assuming that I could use setForeground() and setBackground(). You can use those methods but when it comes to these shapes you’re not using a background color but a fill color.

So I started digging and eventually discovered the com.vp.plugin.format.IShapeUIModelFillColor interface. I knew it was important because this interface provided methods such as setColor1(), setColor2() and setGradientStyle(), but unfortunately I couldn’t make / find the connection. In other words: I was working with IDiagramElement but I needed something else to actually gain access to these more advanced properties.

That’s where our friends from Visual Paradigm came into play: I discovered an article on their knowhow website which demonstrates how to change element colors using a plugin. Probably needless to say but that was seriously helpful! They also have some very useful example plugins ready for download.

The good news is that I have full control over these operations right now. I know how to retrieve and set the required properties, namely: font name, size, style and color, and the element fill color and associated aspects (fill style & transparency). The bad news is that I can’t find any reference to possible default values, so I’ll probably start by looking up & storing these values in my plugin.

So yeah… I got to tell you, this Plugin API opens up a whole new world :sunglasses:

Well, I have good news and I have bad news :wink:

The good news is that I did it and it was a lot of fun. My plugin can easily transform this:


(what a mess! :open_mouth:)

… into this:

The best part is that my plugin does not contain any pre-determined values. Which means that it will fully honor any formatting defaults specified by your project and it can be used on any diagram type you want. So for example: in my UML diagrams any note models have a gradient cyan color. By default this is plain cyan. So if I were to use this plugin on an UML diagram with a weird formatting then it will reset the note back to the gradient color scheme.

But for someone who uses the default color scheme the plugin would change the formatting into that (the default cyan setup).

Now, I won’t bore you with Java code and all (but code is included with the plugin, it’s fully open source :wink:) but considering we’re all Visual Paradigm users I obviously can’t resist sharing this to explain the general plugins inner workings:

Downloading

The plugin is called ResetFormat.zip and can be downloaded here (from my puush repository).

Installation is very easy:

  • Start Visual Paradigm and open the ‘Help’ tab.
  • Click “Install Plugin” and select “Install from a zip of plugin” and click Next.
  • Point to the zip file you downloaded.

The plugin will get installed to %appdata%\VisualParadigm\Plugin and becomes active once you restarted VP. You’ll notice it being active when the ‘Plugin’ tab appears (that’s also where you’ll find the option to click) but it will also announce itself in your VP log.

There’s one caveat I’m still working on: when used something within VP triggers a NullPointerException (not the plugin itself) and that can cause some garbage in your vp logfile. I’m still trying to find out what’s causing it but I’ll probably ask VP for help. Even so, other than that this plugin is fully usable.

Hope this will be useful for you :slight_smile:

1 Like

Hey ShelLuser - this is pretty neat stuff.

I just look at the code and it looks solid. I can’t wait to try it.

Thanks so much for taking the time. Much appreciated. :bowing_man:

1 Like

Hi SheLuser,

Thank you very much for your contributions. It should be a problem of VP, we will check what caused the exception.

Best Regards,

Antony.

2 Likes

Hi ShelLuser.

I just tested the plugin. It works like a charm.

I’m attaching a quick video that shows how it works!

Thanks for your help!

Hi ShelLuser,

The Null Pointer Exception problem on your plugin is caused by an error in Open API, which is just fixed. Please update your VP client to latest v14.2 patch build 20170945cq or later to get the issue fixed. Details about update to latest patch can be found at

Feel free to contact me for any questions and wish you have a good day!

Best regards,
Rain Wong

1 Like

Awesome, thanks for the heads up!

I’ll also update the documentation / readme in my patch accordingly (I noticed that it’s been downloaded multiple times).