Hallo zusammen,
ich habe beim Kunden vor Ort folgendes Szenario:
Im JavaClient werden Klassen aus einer Modulbibliothek aufgerufen. Einige davon sollen Workflows nicht nur starten sondern auch Transitionen schalten. Für Workflows, die ausschließlich manuelle Transitionen besitzen ist dies kein Problem mit diesem Code:
final Task task = us.getTask(Long.parseLong(taskId));
if (task == null) {
context.logInfo("The task does not exist. Execution is aborted.");
return;
}
final MockWorkflowContext wc = new MockWorkflowContext(task, con);
final MockWorkflowScriptContext mwsc =
new MockWorkflowScriptContext(context, con, wc, task);
wc.setMockWorkflowScriptContext(mwsc);
final Transition sourceTrans =
mwsc.getTransition(task, WorkflowConstants.TRANSITION_ACTION);
final Transition targetTrans =
mwsc.getTransition(task, WorkflowConstants.TRANSITION_TARGET);
if (task.isFinished() || task.getErrorInfo() != null) {
context.logInfo("The task for the element " +
task.getWorkflowable().toString()
+ " was finished or has an error. Execution is aborted.");
…
wc.setTargetTransition(new TransitionParametersImpl(targetTrans,
task.getDueDate(),
task
.getPriority(),
task.getCustomData(),
"timed execution",
cmsUtil.getGroup(
context.getProject(), "Administrators")));
task.save();
task.doTransition(wc, sourceTrans);
task.save();
task.unlock();
task.refresh();
Folgende Fehlermeldung tritt auf, sobald nach einer Manuellen Aktion eine automatische folgt:
Caused by: java.lang.IllegalArgumentException: 'Final' is not a valid target transition from state 'wfstate'!
Was muss ich in dieser Situation anders machen?
Vielen Dank im Voraus,
Jürgen Warias