th_biedermann
Occasional Collector

Workflow läuft nicht durch

Jump to solution

Hallo zusammen

Ich habe einen WF angepasst der mir nun leider nicht mehr durchläuft. Ein Fehler wird nicht ausgegeben.

Ich finde das Problem nicht. Der Scipt write statistics läuft auch durch, denn die Werte werden gesetzt.

Irgend jemand eine Idee?

snap022.png

Grüsse. Thomas

0 Kudos
16 Replies

Hallo Holger

Ich habe den Script erweitert mit context.doTransition("statistics written")

//!Beanshell
import java.util.Date;

element = context.getElement();
//context.logInfo("Element: " + element.getClass().getName());

if (!element.isLocked()) {
    element.setLock(true);
}
					
formData = element.getFormData();
formData.get(null, "db_was_sent").set(true);
formData.get(null, "db_was_sent_date").set(new Date());

element.setFormData(formData);
element.save();
element.release();

if(element.isLocked()) {
    element.setLock(false);
}

context.logInfo("Statistic written to dataset");
context.doTransition("statistics written");

Jetzt erhalten ich folgenden Fehler:

FSVersion=5.2.220907.37fca51#7377;JDK=11.0.11 64bit AdoptOpenJDK;OS=Windows 10 10.0 amd64;Date=19.10.2022 13:57:16 (I)
de.espirit.firstspirit.access.script.ExecutionException: Method Invocation context.doTransition : at Line: 24 : in file: inline evaluation of: ``__execute() { //!Beanshell import java.util.Date;  element = context.getElement( . . . '' : context .doTransition ( "statistics written" ) 

Called from method: __execute
Target exception: java.lang.IllegalArgumentException: Transition 'statistics written' not found!
 at line 24
	at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:109)
	at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:84)
	at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.lambda$execute$0(PermissionsScriptEngine.java:77)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:88)
	at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:77)
	at de.espirit.firstspirit.client.gui.applications.ApplicationTabRegistry$IdentifiableExecutable.execute(ApplicationTabRegistry.java:104)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1148)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doAutomaticActivities(TaskImpl.java:1617)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1237)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1085)
	at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:500)
	at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:98)
	at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:110)
	at de.espirit.firstspirit.client.action.WorkflowUtil.startWorkflow(WorkflowUtil.java:66)
	at de.espirit.firstspirit.ui.actions.workflows.WorkflowStartAction.perform(WorkflowStartAction.java:40)
	at de.espirit.firstspirit.ui.actions.swing.Popups$ActionModel.onSelection(Popups.java:145)
	at de.espirit.firstspirit.ui.common.popup.PopupMenuItem$Model.onSelection(PopupMenuItem.java:104)
	at de.espirit.firstspirit.ui.common.popup.PopupImpl$ItemImpl.lambda$new$0(PopupImpl.java:185)
	at de.espirit.firstspirit.client.gui.util.GuiUtil$RunnableWrapper.run(GuiUtil.java:1991)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Transition 'statistics written' not found!
0 Kudos

Hallo Holger

Ich habe den Script erweitert mit context.doTransition("statistics written")

 

//!Beanshell
import java.util.Date;

element = context.getElement();
//context.logInfo("Element: " + element.getClass().getName());

if (!element.isLocked()) {
    element.setLock(true);
}
					
formData = element.getFormData();
formData.get(null, "db_was_sent").set(true);
formData.get(null, "db_was_sent_date").set(new Date());

element.setFormData(formData);
element.save();
element.release();

if(element.isLocked()) {
    element.setLock(false);
}

context.logInfo("Statistic written to dataset");
context.doTransition("statistics written");

 

 Jedoch erhalten ich einen Fehler. Kann die Fehlermeldung nicht posten. Post wird nicht gespeichert 😞

0 Kudos

Fehlermeldung:

Client Version: 5.2.220907.37fca51
Java Version: 11.0.11 AdoptOpenJDK

FSVersion=5.2.220907.37fca51#7377;JDK=11.0.11 64bit AdoptOpenJDK;OS=Windows 10 10.0 amd64;Date=19.10.2022 13:57:16 (I)
de.espirit.firstspirit.access.script.ExecutionException: Method Invocation context.doTransition : at Line: 24 : in file: inline evaluation of: ``__execute() { //!Beanshell import java.util.Date; element = context.getElement( . . . '' : context .doTransition ( "statistics written" )

Called from method: __execute
Target exception: java.lang.IllegalArgumentException: Transition 'statistics written' not found!
at line 24
at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:109)
at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:84)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.lambda$execute$0(PermissionsScriptEngine.java:77)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:88)
at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:77)
at de.espirit.firstspirit.client.gui.applications.ApplicationTabRegistry$IdentifiableExecutable.execute(ApplicationTabRegistry.java:104)
at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1148)
at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doAutomaticActivities(TaskImpl.java:1617)
at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1237)
at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1085)
at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:500)
at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:98)
at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:110)
at de.espirit.firstspirit.client.action.WorkflowUtil.startWorkflow(WorkflowUtil.java:66)
at de.espirit.firstspirit.ui.actions.workflows.WorkflowStartAction.perform(WorkflowStartAction.java:40)
at de.espirit.firstspirit.ui.actions.swing.Popups$ActionModel.onSelection(Popups.java:145)
at de.espirit.firstspirit.ui.common.popup.PopupMenuItem$Model.onSelection(PopupMenuItem.java:104)
at de.espirit.firstspirit.ui.common.popup.PopupImpl$ItemImpl.lambda$new$0(PopupImpl.java:185)
at de.espirit.firstspirit.client.gui.util.GuiUtil$RunnableWrapper.run(GuiUtil.java:1991)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Transition 'statistics written' not found!

0 Kudos
FSVersion=5.2.220907.37fca51#7377;JDK=11.0.11 64bit AdoptOpenJDK;OS=Windows 10 10.0 amd64;Date=19.10.2022 13:57:16 (I)
de.espirit.firstspirit.access.script.ExecutionException: Method Invocation context.doTransition : at Line: 24 : in file: inline evaluation of: ``__execute() { //!Beanshell import java.util.Date;  element = context.getElement( . . . '' : context .doTransition ( "statistics written" ) 

Called from method: __execute
Target exception: java.lang.IllegalArgumentException: Transition 'statistics written' not found!
 at line 24
	at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:109)
	at de.espirit.firstspirit.server.script.BeanshellScriptEngine$BeanshellExecutable.execute(BeanshellScriptEngine.java:84)
	at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.lambda$execute$0(PermissionsScriptEngine.java:77)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:88)
	at de.espirit.firstspirit.server.script.PermissionsScriptEngine$PermissionsExecutable.execute(PermissionsScriptEngine.java:77)
	at de.espirit.firstspirit.client.gui.applications.ApplicationTabRegistry$IdentifiableExecutable.execute(ApplicationTabRegistry.java:104)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1148)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doAutomaticActivities(TaskImpl.java:1617)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1237)
	at de.espirit.firstspirit.server.taskmanagement.TaskImpl.doTransition(TaskImpl.java:1085)
	at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:500)
	at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:98)
	at de.espirit.firstspirit.agency.WorkflowClientAgentImpl.startWorkflow(WorkflowClientAgentImpl.java:110)
	at de.espirit.firstspirit.client.action.WorkflowUtil.startWorkflow(WorkflowUtil.java:66)
	at de.espirit.firstspirit.ui.actions.workflows.WorkflowStartAction.perform(WorkflowStartAction.java:40)
	at de.espirit.firstspirit.ui.actions.swing.Popups$ActionModel.onSelection(Popups.java:145)
	at de.espirit.firstspirit.ui.common.popup.PopupMenuItem$Model.onSelection(PopupMenuItem.java:104)
	at de.espirit.firstspirit.ui.common.popup.PopupImpl$ItemImpl.lambda$new$0(PopupImpl.java:185)
	at de.espirit.firstspirit.client.gui.util.GuiUtil$RunnableWrapper.run(GuiUtil.java:1991)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Transition 'statistics written' not found!
0 Kudos

Target exception: java.lang.IllegalArgumentException: Transition 'statistics written' not found!
at line 24

0 Kudos

Hallo Holger

Das Problem wurde gefunden und behoben.

Es lag noch an den Rechten "Aus den Rechten am Zielobjekt" "Ändern"

Danke und Grüsse.

Thomas

0 Kudos

Danke für das Posten der Lösung. Bei mir hat tatsächlich auch einfach nur die Berechtigung gefehlt. Habe es dann im "Permission" Tab explizit auf "Everyone" gesetzt.

0 Kudos