From 8798695b4e3480ed8f87052cdd8d9e03724c32cb Mon Sep 17 00:00:00 2001 From: Dofs Serge Date: Thu, 24 Jan 2019 04:55:54 +0300 Subject: [PATCH 1/6] rm529note2: task assign log shows assigned actors --- .../java/ru/runa/wfe/audit/TaskAssignLog.java | 27 ++++++++++++++----- .../audit/presentation/ExecutorIdsValue.java | 9 ++++--- .../webapp/WEB-INF/classes/struts.properties | 2 +- .../WEB-INF/classes/struts_ru.properties | 2 +- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/wfe-core/src/main/java/ru/runa/wfe/audit/TaskAssignLog.java b/wfe-core/src/main/java/ru/runa/wfe/audit/TaskAssignLog.java index 32d3ff9c25..a1c17a225e 100644 --- a/wfe-core/src/main/java/ru/runa/wfe/audit/TaskAssignLog.java +++ b/wfe-core/src/main/java/ru/runa/wfe/audit/TaskAssignLog.java @@ -21,17 +21,22 @@ */ package ru.runa.wfe.audit; +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import java.util.List; +import java.util.Set; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.Transient; - +import ru.runa.wfe.audit.presentation.ExecutorIdsValue; import ru.runa.wfe.audit.presentation.ExecutorNameValue; import ru.runa.wfe.task.Task; +import ru.runa.wfe.user.Actor; import ru.runa.wfe.user.Executor; /** * Logging task assignment. - * + * * @author Dofs */ @Entity @@ -42,14 +47,19 @@ public class TaskAssignLog extends TaskLog { public TaskAssignLog() { } - public TaskAssignLog(Task task, Executor newExecutor) { + public TaskAssignLog(Task task, Executor oldExecutor, Executor newExecutor, Set actors) { super(task); - if (task.getExecutor() != null) { - addAttribute(ATTR_OLD_VALUE, task.getExecutor().getName()); + if (oldExecutor != null) { + addAttribute(ATTR_OLD_VALUE, oldExecutor.getName()); } if (newExecutor != null) { addAttribute(ATTR_NEW_VALUE, newExecutor.getName()); } + List ids = Lists.newArrayList(); + for (Executor executor : actors) { + ids.add(executor.getId()); + } + addAttribute(ATTR_MESSAGE, Joiner.on(ExecutorIdsValue.DELIM).join(ids)); setSeverity(Severity.INFO); } @@ -63,10 +73,15 @@ public String getNewExecutorName() { return getAttribute(ATTR_NEW_VALUE); } + @Transient + public String getExecutorIds() { + return getAttribute(ATTR_MESSAGE); + } + @Override @Transient public Object[] getPatternArguments() { - return new Object[] { getTaskName(), new ExecutorNameValue(getAttribute(ATTR_NEW_VALUE)) }; + return new Object[] { getTaskName(), new ExecutorNameValue(getAttribute(ATTR_NEW_VALUE)), new ExecutorIdsValue(getExecutorIds()) }; } @Override diff --git a/wfe-core/src/main/java/ru/runa/wfe/audit/presentation/ExecutorIdsValue.java b/wfe-core/src/main/java/ru/runa/wfe/audit/presentation/ExecutorIdsValue.java index c606c01a66..4072331fb1 100644 --- a/wfe-core/src/main/java/ru/runa/wfe/audit/presentation/ExecutorIdsValue.java +++ b/wfe-core/src/main/java/ru/runa/wfe/audit/presentation/ExecutorIdsValue.java @@ -1,10 +1,9 @@ package ru.runa.wfe.audit.presentation; +import com.google.common.collect.Lists; import java.io.Serializable; import java.util.List; -import com.google.common.collect.Lists; - public class ExecutorIdsValue implements Serializable { private static final long serialVersionUID = 1L; public static final String DELIM = ";"; @@ -14,8 +13,10 @@ public ExecutorIdsValue() { } public ExecutorIdsValue(String idsString) { - for (String idString : idsString.split(DELIM, -1)) { - ids.add(Long.valueOf(idString)); + if (idsString != null) { + for (String idString : idsString.split(DELIM, -1)) { + ids.add(Long.valueOf(idString)); + } } } diff --git a/wfe-web/src/main/webapp/WEB-INF/classes/struts.properties b/wfe-web/src/main/webapp/WEB-INF/classes/struts.properties index 7765572215..16fd33378f 100644 --- a/wfe-web/src/main/webapp/WEB-INF/classes/struts.properties +++ b/wfe-web/src/main/webapp/WEB-INF/classes/struts.properties @@ -233,7 +233,7 @@ history.log.SendMessageLog = Sent message {0} history.log.SubprocessEndLog = Subprocess {0} completed history.log.SubprocessStartLog = Subprocess {0} started history.log.SwimlaneAssignLog = Swimlane {0} assigned to {1} -history.log.TaskAssignLog = Task {0} assigned to executor {1} +history.log.TaskAssignLog = Task {0} assigned to executor {1} (new are: {2}) history.log.TaskCancelledLog = Task {0} was cancelled by handler {1} history.log.TaskCreateLog = Created task {0} history.log.TaskDelegationLog = Task {0} delegated to {1} by {2} diff --git a/wfe-web/src/main/webapp/WEB-INF/classes/struts_ru.properties b/wfe-web/src/main/webapp/WEB-INF/classes/struts_ru.properties index 7bb3f2f291..38f7bb0fa0 100644 --- a/wfe-web/src/main/webapp/WEB-INF/classes/struts_ru.properties +++ b/wfe-web/src/main/webapp/WEB-INF/classes/struts_ru.properties @@ -228,7 +228,7 @@ history.log.SendMessageLog = \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u0 history.log.SubprocessEndLog = \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d \u043f\u043e\u0434\u043f\u0440\u043e\u0446\u0435\u0441\u0441 {0} history.log.SubprocessStartLog = \u0417\u0430\u043f\u0443\u0449\u0435\u043d \u043f\u043e\u0434\u043f\u0440\u043e\u0446\u0435\u0441\u0441 {0} history.log.SwimlaneAssignLog = \u0420\u043e\u043b\u044c-\u0434\u043e\u0440\u043e\u0436\u043a\u0430 {0} \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044e {1} -history.log.TaskAssignLog = \u0417\u0430\u0434\u0430\u043d\u0438\u0435 {0} \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044e {1} +history.log.TaskAssignLog = \u0417\u0430\u0434\u0430\u043d\u0438\u0435 {0} \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044e {1} (\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b: {2}) history.log.TaskCancelledLog = \u0417\u0430\u0434\u0430\u043d\u0438\u0435 {0} \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c {1} history.log.TaskCreateLog = \u0421\u043e\u0437\u0434\u0430\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 {0} history.log.TaskDelegationLog = \u0417\u0430\u0434\u0430\u043d\u0438\u0435 {0} \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043e {1} \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c {2} From 429cfcc88630d21a216676cae742d9a05fb68f1d Mon Sep 17 00:00:00 2001 From: Dofs Date: Sun, 3 Feb 2019 12:55:46 +0300 Subject: [PATCH 2/6] compilation fix --- wfe-core/src/main/java/ru/runa/wfe/task/Task.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wfe-core/src/main/java/ru/runa/wfe/task/Task.java b/wfe-core/src/main/java/ru/runa/wfe/task/Task.java index dda4312bd3..90969b4392 100644 --- a/wfe-core/src/main/java/ru/runa/wfe/task/Task.java +++ b/wfe-core/src/main/java/ru/runa/wfe/task/Task.java @@ -43,8 +43,6 @@ import org.apache.commons.logging.LogFactory; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; -import org.hibernate.annotations.Cascade; -import org.hibernate.annotations.CascadeType; import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.ForeignKey; import org.hibernate.annotations.Index; @@ -67,7 +65,9 @@ import ru.runa.wfe.lang.InteractionNode; import ru.runa.wfe.lang.TaskDefinition; import ru.runa.wfe.task.logic.TaskNotifier; +import ru.runa.wfe.user.Actor; import ru.runa.wfe.user.Executor; +import ru.runa.wfe.user.Group; /** * is one task that can be assigned to an actor (read: put in someone's task list) and that can trigger the continuation of execution of the token @@ -272,9 +272,13 @@ public void assignExecutor(ExecutionContext executionContext, Executor executor, if (!Objects.equal(getExecutor(), executor)) { log.debug("assigning " + this + " to " + executor); Executor previousExecutor = getExecutor(); - // log this assignment - executionContext.addLog(new TaskAssignLog(this, executor)); - // do the actual assignment + Set assignedActors; + if (executor instanceof Group) { + assignedActors = Sets.newHashSet(ApplicationContextFactory.getExecutorDAO().getGroupActors((Group) executor)); + } else { + assignedActors = Sets.newHashSet((Actor) executor); + } + executionContext.addLog(new TaskAssignLog(this, previousExecutor, executor, assignedActors)); setExecutor(executor); setAssignDate(new Date()); InteractionNode node = (InteractionNode) executionContext.getProcessDefinition().getNodeNotNull(nodeId); From 8df06bd9beae46298ee5b5ed0b84d38092bc0eca Mon Sep 17 00:00:00 2001 From: Dofs Date: Thu, 9 May 2019 11:25:16 +0300 Subject: [PATCH 3/6] removed legacy adminkit from source --- .../conf/bot/TextFileTemplate_demo.txt | 8 - .../default/conf/bot/demo/soapBot-whois.xml | 39 ---- .../conf/bot/handler/assigner1.properties | 2 - .../conf/bot/handler/msword-report.xml | 12 - .../default/conf/bot/handler/soapBotTest.xml | 9 - .../default/conf/bot/handler/text-report.xml | 6 - .../default/conf/bot/handler/textFile.xml | 12 - .../default/conf/bot/handler/update1.xml | 13 -- .../default/conf/bot/sample-template.doc | Bin 26624 -> 0 bytes .../src/main/adminkit/conf/jndi.properties | 6 - .../adminkit/conf/wfe.custom.ejb.properties | 16 -- wfe-core/src/main/adminkit/ldap-importer.bat | 14 -- wfe-core/src/main/adminkit/ldap-importer.sh | 10 - wfe-core/src/main/adminkit/lib/content | 10 - wfe-core/src/main/adminkit/log4j.xml | 36 --- wfe-core/src/main/adminkit/script-runner.bat | 18 -- wfe-core/src/main/adminkit/script-runner.sh | 19 -- .../scripts/deploy-samples-script.xml | 209 ------------------ .../scripts/features-demonstration-script.xml | 142 ------------ .../scripts/test-archive-remove-processes.xml | 29 --- 20 files changed, 610 deletions(-) delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/TextFileTemplate_demo.txt delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/demo/soapBot-whois.xml delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/handler/assigner1.properties delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/handler/msword-report.xml delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/handler/soapBotTest.xml delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/handler/text-report.xml delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/handler/textFile.xml delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/handler/update1.xml delete mode 100644 wfe-bots/src/main/jboss/server/default/conf/bot/sample-template.doc delete mode 100644 wfe-core/src/main/adminkit/conf/jndi.properties delete mode 100644 wfe-core/src/main/adminkit/conf/wfe.custom.ejb.properties delete mode 100644 wfe-core/src/main/adminkit/ldap-importer.bat delete mode 100644 wfe-core/src/main/adminkit/ldap-importer.sh delete mode 100644 wfe-core/src/main/adminkit/lib/content delete mode 100644 wfe-core/src/main/adminkit/log4j.xml delete mode 100644 wfe-core/src/main/adminkit/script-runner.bat delete mode 100644 wfe-core/src/main/adminkit/script-runner.sh delete mode 100644 wfe-core/src/main/adminkit/scripts/deploy-samples-script.xml delete mode 100644 wfe-core/src/main/adminkit/scripts/features-demonstration-script.xml delete mode 100644 wfe-core/src/main/adminkit/scripts/test-archive-remove-processes.xml diff --git a/wfe-bots/src/main/jboss/server/default/conf/bot/TextFileTemplate_demo.txt b/wfe-bots/src/main/jboss/server/default/conf/bot/TextFileTemplate_demo.txt deleted file mode 100644 index 8e01a7972e..0000000000 --- a/wfe-bots/src/main/jboss/server/default/conf/bot/TextFileTemplate_demo.txt +++ /dev/null @@ -1,8 +0,0 @@ - Report title: ${header}. - - number: ${number} - date: ${date} - - - Text: -${mainText} \ No newline at end of file diff --git a/wfe-bots/src/main/jboss/server/default/conf/bot/demo/soapBot-whois.xml b/wfe-bots/src/main/jboss/server/default/conf/bot/demo/soapBot-whois.xml deleted file mode 100644 index b59b2fae3e..0000000000 --- a/wfe-bots/src/main/jboss/server/default/conf/bot/demo/soapBot-whois.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - http://www.webservicex.net/whois.asmx - http://www.webservicex.net/GetWhoIS - POST - IGNORE - true - - - - - - - - - -]]> - - - - - - - - - - - - - - - - - -]]> - - - \ No newline at end of file diff --git a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/assigner1.properties b/wfe-bots/src/main/jboss/server/default/conf/bot/handler/assigner1.properties deleted file mode 100644 index 1691a3ed89..0000000000 --- a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/assigner1.properties +++ /dev/null @@ -1,2 +0,0 @@ -swimlaneName = dddSwimlane -assignerFunction = ru.runa.af.organizationfunction.FirstParameterAssignerFunction(${executorId}) diff --git a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/msword-report.xml b/wfe-bots/src/main/jboss/server/default/conf/bot/handler/msword-report.xml deleted file mode 100644 index ff7a6ee35b..0000000000 --- a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/msword-report.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/soapBotTest.xml b/wfe-bots/src/main/jboss/server/default/conf/bot/handler/soapBotTest.xml deleted file mode 100644 index edc7e686b6..0000000000 --- a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/soapBotTest.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/text-report.xml b/wfe-bots/src/main/jboss/server/default/conf/bot/handler/text-report.xml deleted file mode 100644 index a346a05190..0000000000 --- a/wfe-bots/src/main/jboss/server/default/conf/bot/handler/text-report.xml +++ /dev/null @@ -1,6 +0,0 @@ - - -