Minimal Cockpit "history plugins" for Camunda >= 7.14.0

Since Cockpit plugins are now easy to develop after Camunda 7.14.0, I’ve been writing simple plugins for myself to give some visibility into completed activities and processes. Last year, when really learning Camunda myself, “disappearing completed processes” on Cockpit was my greatest source of frustration in learning and and trying out BPMN with Camunda.

A small writing at: https://datakurre.pandala.org/2021/01/camunda-cockpit-history-plugin/

Source and built bundles at: https://github.com/datakurre/camunda-cockpit-plugins/

The current featureset is quite minimal with missing pieces everywhere, but I assume that I keep updating those while require more and better features myself during this year.

16 Likes

This is really great! thanks for sharing!

1 Like

For extra fun, a new branch with sequence flow visualization from https://github.com/nikku/camunda-playground

(Definitely needs an on/off-switch, which again needs some major refactoring, before could be merged.)

5 Likes

for camunda in docker, just need to create custom Dockerfile like this:

FROM camunda/camunda-bpm-platform:tomcat-7.14.0
RUN rm -r webapps/camunda-invoice webapps/examples webapps/h2
COPY cfg/postgresql-42.2.16.jar /camunda/lib/postgresql-9.4.1212.jar
COPY cfg/web.xml /camunda/webapps/engine-rest/WEB-INF/web.xml
COPY cfg/bpm-platform.xml /camunda/conf/

Custom pluging for cockpit: adding history data in interface

COPY cfg/scripts/* /camunda/webapps/camunda/app/cockpit/scripts/

with config.js, instance-historic-activities.js, definition-historic-activities.js, instance-route-history.js in scripts directory

1 Like

On Linux and MacOS it should be also possible to mount the plugins in:

$ git clone https://github.com/datakurre/camunda-cockpit-plugins.git
$ docker run --rm -p 8080:8080 -v $(pwd)/camunda-cockpit-plugins:/camunda/webapps/camunda/app/cockpit/scripts/:ro camunda/camunda-bpm-platform:latest
1 Like

Really nice, thanks for sharing, @datakurre. Quick question: How can I “blend” your plugin into the cockpit library when I’m using the Spring Boot approach with Camunda. There, the library comes as a dependency “org.camunda.bpm.webapp:camunda-webapp-webjar:7.14.0”. I also read https://camunda.com/blog/2020/08/all-new-frontend-plugin-system-for-cockpit-starting-with-camunda-bpm-7-14/ but couldn’t find a description to add it to the cockpit with an external reference. My assumption is that I have to patch this library, i.e. get the jar file, get your plugin files and patch the webapp jar with your files and then use that newly patch jar file. Is my assumption correct? If yes, is there anybody out there having done that already, with some script magic to share here? Thanks.

2 Likes

If I understood properly, all files could go into your spring boot application package, into

./src/main/resources/META-INF/resources/webjars/camunda/app/cockpit/scripts

The main file is config.js which “overrides” the default in webjar in precedence and defines the plugins to include.

3 Likes

Works like a charm. :smiley: Thanks!

2 Likes

Feel free to give feedback about the most important missing things. Possibly as GitHub issues :slightly_smiling_face:

1 Like

Hello,

This plugins looks very nice !

Unfortunately I’m not able to find any documentation on how to add a cockpit plugin to camunda/camunda-bpm-platform:run-7.14.0 distribution.

Any idea on how to do it ?
I tried something like COPY camunda-cockpit-plugins/* /camunda/internal/webapps/camunda/app/cockpit/scripts/ with multiple different paths but no one is working on my side.

Is someone able to help me ?

Thanks in advance !

Hey @canthony,

I haven’t tried it myself to be honest, but from the top of my head I’d say you should be able to add your files to configuration/userlib/META-INF/resources/webjars/camunda/app/cockpit/scripts in Run, resulting in the files being present on the classpath starting with META-INF/... as they would be with the “pure” Spring Boot approach (if I am not horribly mistaken on that one).

As I said, haven’t tried it myself but that could do the trick.

Best,
Tobias

Hi @tmetzke thanks for your answer !

Unfortunately I tried it but it doesn’t works on my side.

Anthony

Hey @canthony, thanks for the update.

Too bad this doesn’t work for you. I will try to follow-up on this within the next days.
In the meantime, if someone else has already achieved this, feel free to update here :slight_smile:

@canthony, could you detail a bit more what exactly you tried? Did you override the config.js as well as @datakurre mentioned?

Hi,

I tried to copy all script files into configuration/userlib/META-INF/resources/webjars/camunda/app/cockpit/scripts within my dockerfile.

FROM camunda/camunda-bpm-platform:run-7.14.0
COPY --chown=camunda:camunda scripts/* configuration/userlib/META-INF/resources/webjars/camunda/app/cockpit/scripts/

Following @datakurre’s tutorial I’m able to use the plugin without using the run image.

Thanks for help,
Anthony

2 Likes

Finally managed to find time to add toggle for sequence flow rendering, and that is now merged into master:

While the rendering works for my current use cases, there must be unimaginable amount of corner cases where it fails to render correctly. Issues with example processes are welcome.

Since the first versions, there are also some other minor improvements like linking historic sub process and DMN executions from “Audit Log”.

Next up is some hidden refactoring to make bundled diagram and tab plugins actually be controlled by the same React app to make them share state and be able to e.g. implement shared filter for historic executions rendered on definition level:

At times,I feel a bit stupid having to re-implement “camunda commons ui” components with inferior versions to have some features taken for granted, but that’s probably the way until upcoming Camunda versions re-introduce commons ui library and it is usable outside Angular.

3 Likes

I finally found a little hack that works for me :

FROM camunda/camunda-bpm-platform:run-7.14.0
COPY --chown=camunda:camunda camunda-cockpit-plugins/* /camunda/META-INF/resources/webjars/camunda/app/cockpit/scripts/

USER root
RUN apk add --no-cache zip
RUN zip -r internal/webapps/camunda-webapp-webjar-7.14.0.jar META-INF
USER camunda
3 Likes

Thanks for sharing, @canthony!

Hey @canthony,

would you mind detailing a bit on how and why this works so others can get a better idea on this particular approach? :smiley:

Official support and documentation of Cockpit Plugins in Camunda Run might come with a future release, but until then I guess it would help a lot of people with the same intentions that find this thread here :slight_smile:

Thanks and best,
Tobias

This is amazing, I am studying how to implement similar history tab in the tasklist. Show audit log of the process-instance currentUser started.
Will some modification to your js file do the job?

1 Like