Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #841 from Netflix/compatibility_fix
Browse files Browse the repository at this point in the history
fix compatibility with 1.x
  • Loading branch information
apanicker-nflx committed Oct 26, 2018
2 parents 26cfd71 + adbcb8a commit 2984618
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright 2016 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,9 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
package com.netflix.conductor.common.metadata.workflow;

import com.github.vmg.protogen.annotations.ProtoField;
Expand All @@ -24,12 +21,14 @@

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
* @author Viren
Expand All @@ -40,6 +39,31 @@
@ProtoMessage
public class WorkflowTask {

/**
* This field is deprecated and will be removed in the next version.
* Please use {@link TaskType} instead.
*/
@Deprecated
public enum Type {
SIMPLE, DYNAMIC, FORK_JOIN, FORK_JOIN_DYNAMIC, DECISION, JOIN, SUB_WORKFLOW, EVENT, WAIT, USER_DEFINED;
private static Set<String> systemTasks = new HashSet<>();
static {
systemTasks.add(Type.SIMPLE.name());
systemTasks.add(Type.DYNAMIC.name());
systemTasks.add(Type.FORK_JOIN.name());
systemTasks.add(Type.FORK_JOIN_DYNAMIC.name());
systemTasks.add(Type.DECISION.name());
systemTasks.add(Type.JOIN.name());
systemTasks.add(Type.SUB_WORKFLOW.name());
systemTasks.add(Type.EVENT.name());
systemTasks.add(Type.WAIT.name());
//Do NOT add USER_DEFINED here...
}
public static boolean isSystemTask(String name) {
return systemTasks.contains(name);
}
}

@ProtoField(id = 1)
private String name;

Expand All @@ -52,7 +76,7 @@ public class WorkflowTask {
//Key: Name of the input parameter. MUST be one of the keys defined in TaskDef (e.g. fileName)
//Value: mapping of the parameter from another task (e.g. task1.someOutputParameterAsFileName)
@ProtoField(id = 4)
private Map<String, Object> inputParameters = new HashMap<String, Object>();
private Map<String, Object> inputParameters = new HashMap<>();

@ProtoField(id = 5)
private String type = TaskType.SIMPLE.name();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public void setCorrelationId(String correlationId) {
*/
@Deprecated
public String getWorkflowType() {
return workflowType;
return getWorkflowName();
}

/**
Expand All @@ -261,7 +261,7 @@ public void setWorkflowType(String workflowType) {
*/
@Deprecated
public int getVersion() {
return version;
return getWorkflowVersion();
}

/**
Expand Down

0 comments on commit 2984618

Please sign in to comment.