Change Enumeration

Description
Lutz
Posts: 4
Joined: Fri Jul 22, 2016 11:19 am

Change Enumeration

Postby Lutz » Wed Mar 07, 2018 7:22 pm

Hi

I want to change an enumeration.
I used repositoryservice to load the xml file.
After that I modified the file and used repositoryservice to store the file back.

The problem is transactionservice.commitTx() crashes at a point I don't have any sources.
The strange thing is the change is commited to SVN. I can see it when I have a look at the file.
But when I try to edit the enum the change is not displayed. POlarion is ignoring the change too.
When I stop and start the server the new enumeration is valid.
When I use the repository view to download and upload the same file again. The enum works also.

Is there anythign special I have to take care about when editing an enumeration?

I have found IRepositoryConfigService. Can I used it and when yes how? I haven't found much information.

Thank you very much.

Lutz
Posts: 4
Joined: Fri Jul 22, 2016 11:19 am

Re: Change Enumeration

Postby Lutz » Thu Mar 08, 2018 12:29 pm

A little bit more code.

I use the following code to write the xml file:

Code: Select all

         // Create Location for new file
         Location target = (Location)Location.getLocation(path);
         
         // Open Transaction with write access
         transactionService.beginTx();
         IRepositoryConnection connection = this.repositoryService.getConnection(target);
         // write and commit changes
         connection.setContent(target, returnStream);
         transactionService.commitTx();


At the commit I get the following output:

Code: Select all

2018-03-08 08:44:16,642 [ajp-nio-8889-exec-4 | u:lutz | uri:/polarion/....../createNewRelease | wiki: view https://......../createNewRelease | u:p] ERROR com.polarion.platform.internal.service.repository.listeners.job.PullingJob  - Error occurred when collecting changes from Subversion repository
java.lang.NullPointerException
      at java.lang.String.compareTo(Unknown Source)
      at com.polarion.platform.repository.internal.config.LocationsHandler$Node.compareTo(LocationsHandler.java:189)
      at com.polarion.platform.repository.internal.config.LocationsHandler$Node.compareTo(LocationsHandler.java:1)
      at java.util.Collections.indexedBinarySearch(Unknown Source)
      at java.util.Collections.binarySearch(Unknown Source)
      at com.polarion.platform.repository.internal.config.LocationsHandler$Node.getChild(LocationsHandler.java:87)
      at com.polarion.platform.repository.internal.config.LocationsHandler$Node.collectKeys(LocationsHandler.java:148)
      at com.polarion.platform.repository.internal.config.LocationsHandler.getKeysAffectedByLocation(LocationsHandler.java:65)
      at com.polarion.platform.repository.internal.config.ConfigCache.invalidateLocationFireListeners(ConfigCache.java:115)
(...)


I get the error at commitTx

I think the problem is there is somethign from polarion which gets informed when an update to SVN is done. This something is responsible to put the changes into the database which is used.

Any ideas?

ALMighty
Posts: 71
Joined: Wed Apr 27, 2016 10:34 am
Location: Austria

Re: Change Enumeration

Postby ALMighty » Fri Mar 09, 2018 2:08 pm

Lutz wrote:The problem is transactionservice.commitTx() crashes at a point...


Point is, everything connected with transactionservice is completely broken currently (probably it worked in Polarion versions before Polarion 2016), at least that is my experience and that is why I recommend abstaining from it.

However probably this will help you:
In my team, we had a similar problem like you, we wanted to sort enumerations.
After several attempts with the transactionservice methods we have gone different path:
One teammember wrote a small Java application that reads a enumeration (the XML file you find in Polarion to be precise) based on the filepath with which it is fed. We let this app run in a Jenkins job, where checking out the enumeration and the application from SVN and then uploading the sorted enumeration back to our Polarions SVN work pretty neat. However you can use other Continuous Integration/Delivery/Deployment tools than Jenkins for this sake, for example you can try out the simplier and also free GoCD from Thoughtworks.

It does not necessarily have to be Java to get the sorting solved as you do not need any Polarion SDK libraries in this case (though I can explain to you how to set such a Java app up if you want). Just pick any language (for suggestions see here or here) you are most comfortable with and which allows you to read, change and save XML files.
---------------------------------------------------------------------------------------------------
Playing a good game is never lame. :D
Image


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 2 guests