📄 updateflowfileflow.java
字号:
/*
* This class was automatically generated by the
* Flow4J-Eclipse Plug-in
* DON'T EDIT THIS FILE!
*/
package net.orthanc.flow4j.flows.updateflowfile;
import net.orthanc.flow4j.runtime.*;
/**
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.GetVersionTask"
* description = "Puts the flow file's version in the dictionary"
* name = "GetVersion"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.GetDOMDocTask"
* description = "Puts the file's DOM document in the dictionary"
* name = "GetDOMDoc"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.TooOldTask"
* description = "Displays a message thet the files version is too old to update"
* name = "TooOld"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.V2ToV3Task"
* description = "Updates version 2 to version 3"
* name = "V2ToV3"
* type-dom_document = "org.w3c.dom.Document"
* desc-dom_document = "the DOM document to update"
* inputParameterNames = "dom_document"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.SetVersionTask"
* description = "Sets the flowXML file's version"
* value-version = "3"
* desc-version = "the new version"
* propertyNames = "version"
* name = "set version (3)"
* type-dom_document = "org.w3c.dom.Document"
* desc-dom_document = "the flow's xml DOM structure"
* inputParameterNames = "dom_document"
* type-version = "java.lang.Integer"
* desc-version = "the flow xml file's new version"
* outputParameterNames = "version"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.FutureVersionTask"
* description = "Throws a Flow4JRuntimeException because the version is one of the future"
* name = "FutureVersion"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.SaveUpdatedFileTask"
* description = "Saves the updated DOM document to file"
* name = "SaveUpdatedFile"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.V3ToV4Task"
* name = "V3ToV4"
* type-dom_document = "org.w3c.dom.Document"
* desc-dom_document = "the DOM document to update"
* inputParameterNames = "dom_document"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.SetVersionTask"
* description = "Sets the flowXML file's version"
* value-version = "4"
* desc-version = "the new version"
* propertyNames = "version"
* name = "set version (4)"
* type-dom_document = "org.w3c.dom.Document"
* desc-dom_document = "the flow's xml DOM structure"
* inputParameterNames = "dom_document"
* type-version = "java.lang.Integer"
* desc-version = "the flow xml file's new version"
* outputParameterNames = "version"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.V4ToV5Task"
* name = "V4ToV5"
* type-dom_document = "org.w3c.dom.Document"
* desc-dom_document = "the DOM document to update"
* inputParameterNames = "dom_document"
*
* @flow4j.task-flowlet
* class = "net.orthanc.flow4j.flows.updateflowfile.SetVersionTask"
* description = "Sets the flowXML file's version"
* value-version = "5"
* desc-version = "the new version"
* propertyNames = "version"
* name = "set version (5)"
* type-dom_document = "org.w3c.dom.Document"
* desc-dom_document = "the flow's xml DOM structure"
* inputParameterNames = "dom_document"
* type-version = "java.lang.Integer"
* desc-version = "the flow xml file's new version"
* outputParameterNames = "version"
*
* @flow4j.flow
* name = "UpdateFlowFile"
*
*/
public final class UpdateFlowFileFlow implements IFlow
{
private static StartFlowlet[] startFlowlets = new StartFlowlet[7];
private static ITaskFlowlet javatask0_GetVersionTask;
private static ITaskFlowlet javatask4_GetDOMDocTask;
private static ITaskFlowlet javatask2_TooOldTask;
private static ITaskFlowlet javatask1_V2ToV3Task;
private static ITaskFlowlet javatask6_SetVersionTask;
private static ITaskFlowlet javatask3_FutureVersionTask;
private static ITaskFlowlet javatask5_SaveUpdatedFileTask;
private static ITaskFlowlet javatask7_V3ToV4Task;
private static ITaskFlowlet javatask8_SetVersionTask;
private static ITaskFlowlet javatask9_V4ToV5Task;
private static ITaskFlowlet javatask10_SetVersionTask;
{
StartFlowlet start_0_Start = new StartFlowlet("Start");
startFlowlets[0] = start_0_Start;
StartFlowlet start_1_v1 = new StartFlowlet("v1");
startFlowlets[1] = start_1_v1;
StartFlowlet start_2_v2 = new StartFlowlet("v2");
startFlowlets[2] = start_2_v2;
StartFlowlet start_3_v5 = new StartFlowlet("v5");
startFlowlets[3] = start_3_v5;
StartFlowlet start_4_save = new StartFlowlet("save");
startFlowlets[4] = start_4_save;
StartFlowlet start_5_v3 = new StartFlowlet("v3");
startFlowlets[5] = start_5_v3;
StartFlowlet start_6_v4 = new StartFlowlet("v4");
startFlowlets[6] = start_6_v4;
javatask0_GetVersionTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.GetVersionTask.class);
javatask4_GetDOMDocTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.GetDOMDocTask.class);
javatask2_TooOldTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.TooOldTask.class);
javatask1_V2ToV3Task = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.V2ToV3Task.class);
javatask6_SetVersionTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.SetVersionTask.class);
javatask6_SetVersionTask.setProperty("version", "3");
javatask3_FutureVersionTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.FutureVersionTask.class);
javatask5_SaveUpdatedFileTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.SaveUpdatedFileTask.class);
javatask7_V3ToV4Task = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.V3ToV4Task.class);
javatask8_SetVersionTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.SetVersionTask.class);
javatask8_SetVersionTask.setProperty("version", "4");
javatask9_V4ToV5Task = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.V4ToV5Task.class);
javatask10_SetVersionTask = FlowManager.registerTaskFlowlet(net.orthanc.flow4j.flows.updateflowfile.SetVersionTask.class);
javatask10_SetVersionTask.setProperty("version", "5");
}
private static final void start_0_Start(FlowDictionary dictionary)
{
javatask0_GetVersionTask.execute(dictionary);
if (dictionary.i("version") == 5) {
// flow ends here
}
else {
javatask4_GetDOMDocTask.execute(dictionary);
start_1_v1(dictionary);
// UpdateFlowFile-v1
}
}
private static final void start_1_v1(FlowDictionary dictionary)
{
if (dictionary.get("version") == null || dictionary.i("version") == 1) {
javatask2_TooOldTask.execute(dictionary);
// flow ends here
}
else {
start_2_v2(dictionary);
// UpdateFlowFile-v2
}
}
private static final void start_2_v2(FlowDictionary dictionary)
{
if (dictionary.i("version") == 2) {
javatask1_V2ToV3Task.execute(dictionary);
javatask6_SetVersionTask.execute(dictionary);
join_0(dictionary);
}
else {
join_0(dictionary);
}
}
private static final void join_0(FlowDictionary dictionary)
{
start_5_v3(dictionary);
// UpdateFlowFile-v3
}
private static final void start_3_v5(FlowDictionary dictionary)
{
if (dictionary.i("version") == 5) {
start_4_save(dictionary);
// UpdateFlowFile-save
}
else {
javatask3_FutureVersionTask.execute(dictionary);
// flow ends here
}
}
private static final void start_4_save(FlowDictionary dictionary)
{
javatask5_SaveUpdatedFileTask.execute(dictionary);
// flow ends here
}
private static final void start_5_v3(FlowDictionary dictionary)
{
if (dictionary.i("version") == 3) {
javatask7_V3ToV4Task.execute(dictionary);
javatask8_SetVersionTask.execute(dictionary);
join_1(dictionary);
}
else {
join_1(dictionary);
}
}
private static final void join_1(FlowDictionary dictionary)
{
start_6_v4(dictionary);
// UpdateFlowFile-v4
}
private static final void start_6_v4(FlowDictionary dictionary)
{
if (dictionary.i("version") == 4) {
javatask9_V4ToV5Task.execute(dictionary);
javatask10_SetVersionTask.execute(dictionary);
join_2(dictionary);
}
else {
join_2(dictionary);
}
}
private static final void join_2(FlowDictionary dictionary)
{
start_3_v5(dictionary);
// UpdateFlowFile-v5
}
public final String getName()
{
return "UpdateFlowFile";
}
public final StartFlowlet[] getStartFlowlets()
{
return startFlowlets;
}
public final void execute(String startFlowletName, FlowDictionary dictionary)
{
if ("Start".equals(startFlowletName)) {
start_0_Start(dictionary);
}
else {
if ("v1".equals(startFlowletName)) {
start_1_v1(dictionary);
}
else {
if ("v2".equals(startFlowletName)) {
start_2_v2(dictionary);
}
else {
if ("v5".equals(startFlowletName)) {
start_3_v5(dictionary);
}
else {
if ("save".equals(startFlowletName)) {
start_4_save(dictionary);
}
else {
if ("v3".equals(startFlowletName)) {
start_5_v3(dictionary);
}
else {
if ("v4".equals(startFlowletName)) {
start_6_v4(dictionary);
}
else {
throw new Flow4JRuntimeException("start node \"" + startFlowletName + "\" not found in flow \"" + this.getClass().getName() + "\"");
}
}
}
}
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -