- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Automatische Workflow-Transitionen via Skript schalten
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
- Labels:
-
Developers
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Die Funktionalitรคt gibt es erst mit FirstSpirit 5.0, unter 4.2 gibt es dafรผr keine API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hallo,
fรผr diese Anforderung gibt es eine API-Schnittstelle รผber die man sowohl Workflows starten, als auch schalten kann und zwar den WorkflowAgent
Gruร
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Das sieht ja gar nicht mal schlecht aus - wenn man nur Version 5.0 oder hรถher hรคtte. Tut mir Leid, dass ich das nicht von vorn herein klar gestellt hatte.
Was kann ich mit Version 4.2.484 machen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Die Funktionalitรคt gibt es erst mit FirstSpirit 5.0, unter 4.2 gibt es dafรผr keine API.

