1
- /**
1
+ /*
2
2
* Copyright 2016 Netflix, Inc.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- /**
17
- *
18
- */
19
16
package com .netflix .conductor .common .metadata .workflow ;
20
17
21
18
import com .github .vmg .protogen .annotations .ProtoField ;
24
21
25
22
import java .util .Collection ;
26
23
import java .util .HashMap ;
24
+ import java .util .HashSet ;
27
25
import java .util .Iterator ;
28
26
import java .util .LinkedHashMap ;
29
27
import java .util .LinkedList ;
30
28
import java .util .List ;
31
29
import java .util .Map ;
32
30
import java .util .Objects ;
31
+ import java .util .Set ;
33
32
34
33
/**
35
34
* @author Viren
40
39
@ ProtoMessage
41
40
public class WorkflowTask {
42
41
42
+ /**
43
+ * This field is deprecated and will be removed in the next version.
44
+ * Please use {@link TaskType} instead.
45
+ */
46
+ @ Deprecated
47
+ public enum Type {
48
+ SIMPLE , DYNAMIC , FORK_JOIN , FORK_JOIN_DYNAMIC , DECISION , JOIN , SUB_WORKFLOW , EVENT , WAIT , USER_DEFINED ;
49
+ private static Set <String > systemTasks = new HashSet <>();
50
+ static {
51
+ systemTasks .add (Type .SIMPLE .name ());
52
+ systemTasks .add (Type .DYNAMIC .name ());
53
+ systemTasks .add (Type .FORK_JOIN .name ());
54
+ systemTasks .add (Type .FORK_JOIN_DYNAMIC .name ());
55
+ systemTasks .add (Type .DECISION .name ());
56
+ systemTasks .add (Type .JOIN .name ());
57
+ systemTasks .add (Type .SUB_WORKFLOW .name ());
58
+ systemTasks .add (Type .EVENT .name ());
59
+ systemTasks .add (Type .WAIT .name ());
60
+ //Do NOT add USER_DEFINED here...
61
+ }
62
+ public static boolean isSystemTask (String name ) {
63
+ return systemTasks .contains (name );
64
+ }
65
+ }
66
+
43
67
@ ProtoField (id = 1 )
44
68
private String name ;
45
69
@@ -52,7 +76,7 @@ public class WorkflowTask {
52
76
//Key: Name of the input parameter. MUST be one of the keys defined in TaskDef (e.g. fileName)
53
77
//Value: mapping of the parameter from another task (e.g. task1.someOutputParameterAsFileName)
54
78
@ ProtoField (id = 4 )
55
- private Map <String , Object > inputParameters = new HashMap <String , Object >();
79
+ private Map <String , Object > inputParameters = new HashMap <>();
56
80
57
81
@ ProtoField (id = 5 )
58
82
private String type = TaskType .SIMPLE .name ();
0 commit comments