camunda-community-hub / camunda-platform-7-osgi

OSGi integration for Camunda Platform 7
Apache License 2.0
22 stars 24 forks source link

Problem getting JobConfiguration #79

Closed andyrozman closed 2 years ago

andyrozman commented 2 years ago

Hi ! I need to update Timer programatically, so I was trying to get correct Job... So Job I get, is of TimerEntity, and I need to get name of the timerConfiguration. I am using 7.15 version of Camunda.

            for (Job job : listOfJobs) {
                if (job instanceof TimerEntity) {
                    TimerEntity timerEntity = (TimerEntity) job;

// 1st Try, throws NPE
                    String jobConfiguration = timerEntity.getJobDefinition().getJobConfiguration();

// 2nd try, again throws NPE
                    TimerJobConfiguration jobHandlerConfiguration = timerEntity.getJobHandlerConfiguration();

                    if ("dafWarningTimer".equals(jobConfiguration)) {
                        targetJob2 = job;
                    }
                }
            }
rbraeunlich commented 2 years ago

Hi @andyrozman Are you sure this is an issue related to the OSGi module? To me it sounds like you should ask in the camunda forums. Additionally, this module does not support camunda 7.15 since there is no maintainer left.

andyrozman commented 2 years ago

I am not sure...

I created workaround for this already... I am just calling toString and then parsing results (creating Map of values)... I know it shouldn't be done that way, but I tried every other method this object has, and none of them seems to be working... All producing NPE...

This can be closed...