AnsweredAssumed Answered

Error while rewriting AdminPanel

Question asked by lossril on Aug 10, 2015
Hello there,

I've tried to change something in Administration part - namely Completed Instances panel - funny thing about it is that completed process instances are sorted by day of the week when you try to sort them by date. When I noticed it, I was like 'okay, clearly not like it should be' and tried to fix it.

The problem is that when Activiti has to show us the information about completed instance (which is represented by HistoricProcessInstance class if I got it correctly), it gets the java.util.Date field, which is good, and then goes .toString(), which is awful due to the fact Date.toString() returns String starting with day of the week, what actually leads to the behavior I described.

How I tried to fix it:
* I wrote dateToString method, which gets Date and returns String in format which can be actually sorted as intended. It clearly works - I've made some tests with dates.
* Then changed refreshInstancesTable() method of class in a way to use my dateToString() instead of toString() - like this:

protected void refreshInstancesTable() {
     for (HistoricProcessInstance instance : selectedManagementDefinition.runningInstances) {
        instancesTable.addItem(new String[]{instance.getId(),
            instance.getEndTime() != null ? instance.getEndTime().toString() : "",
            instance.getDurationInMillis() != null ? instance.getDurationInMillis().toString() : ""},

So on table refresh it should parse startTime my way.

Then i exported activiti-explorer jar(there were some warnings), but eclipse compiled it and copied jar into webapps\activiti-explorer\WEB-INF\lib directory.
Then I restarted Tomcat and got this error:
org.springframework.context.NoSuchMessageException: No message found under code 'login.username' for locale 'en_US'.

org.springframework.context.NoSuchMessageException: No message found under code 'login.username' for locale 'en_US'.
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   com.sun.proxy.$Proxy20.getMessage(Unknown Source)

Activiti installation was blank, no changes besides those described above were made. What did I do wrong and why it happened?