diff --git a/common/src/main/java/com/netflix/conductor/common/metadata/workflow/WorkflowTask.java b/common/src/main/java/com/netflix/conductor/common/metadata/workflow/WorkflowTask.java index c01f43903f..ede596cd51 100644 --- a/common/src/main/java/com/netflix/conductor/common/metadata/workflow/WorkflowTask.java +++ b/common/src/main/java/com/netflix/conductor/common/metadata/workflow/WorkflowTask.java @@ -151,11 +151,29 @@ public void setTasks(List tasks) { @ProtoField(id = 29) private String joinStatus; - @ProtoField(id = 30) - private Map cacheKey = new HashMap<>(); + public static class CacheConfig { - @ProtoField(id = 31) - private long cacheTTL; + private String key; + private int ttlInSecond; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public int getTtlInSecond() { + return ttlInSecond; + } + + public void setTtlInSecond(int ttlInSecond) { + this.ttlInSecond = ttlInSecond; + } + } + + private CacheConfig cacheConfig; /* Map of events to be emitted when the task status changed. @@ -398,20 +416,12 @@ public void setScriptExpression(String expression) { this.scriptExpression = expression; } - public Map getCacheKey() { - return cacheKey; - } - - public void setCacheKey(Map cacheKey) { - this.cacheKey = cacheKey; - } - - public long getCacheTTL() { - return cacheTTL; + public CacheConfig getCacheConfig() { + return cacheConfig; } - public void setCacheTTL(long cacheTTL) { - this.cacheTTL = cacheTTL; + public void setCacheConfig(CacheConfig cacheConfig) { + this.cacheConfig = cacheConfig; } /** @@ -781,6 +791,7 @@ && isOptional() == that.isOptional() && Objects.equals(isAsyncComplete(), that.isAsyncComplete()) && Objects.equals(getDefaultExclusiveJoinTask(), that.getDefaultExclusiveJoinTask()) && Objects.equals(getRetryCount(), that.getRetryCount()) + && Objects.equals(getCacheConfig(), that.getCacheConfig()) && Objects.equals(getOnStateChange(), that.getOnStateChange()); } @@ -813,6 +824,7 @@ public int hashCode() { isOptional(), getDefaultExclusiveJoinTask(), getOnStateChange(), + getCacheConfig(), getRetryCount()); } }