Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static Decision decision(com.uber.cadence.Decision d) {
d.getRequestCancelExternalWorkflowExecutionDecisionAttributes();
RequestCancelExternalWorkflowExecutionDecisionAttributes.Builder builder =
RequestCancelExternalWorkflowExecutionDecisionAttributes.newBuilder()
.setDomain(attr.getDomain())
.setDomain(attr.getDomain() != null ? attr.getDomain() : "")
.setWorkflowExecution(workflowRunPair(attr.getWorkflowId(), attr.getRunId()))
.setChildWorkflowOnly(attr.isChildWorkflowOnly());
if (attr.getControl() != null) {
Expand Down Expand Up @@ -202,7 +202,7 @@ static Decision decision(com.uber.cadence.Decision d) {
d.getStartChildWorkflowExecutionDecisionAttributes();
StartChildWorkflowExecutionDecisionAttributes.Builder builder =
StartChildWorkflowExecutionDecisionAttributes.newBuilder()
.setDomain(attr.getDomain())
.setDomain(attr.getDomain() != null ? attr.getDomain() : "")
.setWorkflowId(attr.getWorkflowId())
.setWorkflowType(workflowType(attr.getWorkflowType()))
.setTaskList(taskList(attr.getTaskList()))
Expand Down Expand Up @@ -234,7 +234,7 @@ static Decision decision(com.uber.cadence.Decision d) {
d.getSignalExternalWorkflowExecutionDecisionAttributes();
SignalExternalWorkflowExecutionDecisionAttributes.Builder builder =
SignalExternalWorkflowExecutionDecisionAttributes.newBuilder()
.setDomain(attr.getDomain())
.setDomain(attr.getDomain() != null ? attr.getDomain() : "")
.setWorkflowExecution(workflowExecution(attr.getExecution()))
.setSignalName(attr.getSignalName())
.setInput(payload(attr.getInput()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ public static CountWorkflowExecutionsRequest countWorkflowExecutionsRequest(
return null;
}
CountWorkflowExecutionsRequest.Builder request =
CountWorkflowExecutionsRequest.newBuilder().setDomain(t.getDomain());
CountWorkflowExecutionsRequest.newBuilder()
.setDomain(t.getDomain() != null ? t.getDomain() : "");
if (t.getQuery() != null) {
request.setQuery(t.getQuery());
}
Expand All @@ -134,7 +135,7 @@ public static DescribeTaskListRequest describeTaskListRequest(
return null;
}
return DescribeTaskListRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setTaskList(taskList(t.getTaskList()))
.setTaskListType(taskListType(t.getTaskListType()))
.setIncludeTaskListStatus(t.isIncludeTaskListStatus())
Expand All @@ -148,7 +149,7 @@ public static ListArchivedWorkflowExecutionsRequest listArchivedWorkflowExecutio
}
ListArchivedWorkflowExecutionsRequest.Builder request =
ListArchivedWorkflowExecutionsRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setPageSize(t.getPageSize());
if (t.getNextPageToken() != null) {
request.setNextPageToken(arrayToByteString(t.getNextPageToken()));
Expand All @@ -166,7 +167,7 @@ public static RequestCancelWorkflowExecutionRequest requestCancelWorkflowExecuti
}
RequestCancelWorkflowExecutionRequest.Builder builder =
RequestCancelWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getWorkflowExecution()))
.setRequestId(t.getRequestId());
if (t.getIdentity() != null) {
Expand All @@ -187,7 +188,7 @@ public static ResetStickyTaskListRequest resetStickyTaskListRequest(
return null;
}
return ResetStickyTaskListRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getExecution()))
.build();
}
Expand All @@ -198,7 +199,7 @@ public static ResetWorkflowExecutionRequest resetWorkflowExecutionRequest(
return null;
}
return ResetWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getWorkflowExecution()))
.setReason(t.getReason() != null ? t.getReason() : "")
.setDecisionFinishEventId(t.getDecisionFinishEventId())
Expand All @@ -214,7 +215,7 @@ public static RespondActivityTaskCanceledByIDRequest respondActivityTaskCanceled
}
RespondActivityTaskCanceledByIDRequest.Builder builder =
RespondActivityTaskCanceledByIDRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(TypeMapper.workflowRunPair(t.getWorkflowID(), t.getRunID()))
.setActivityId(t.getActivityID())
.setDetails(payload(t.getDetails()));
Expand Down Expand Up @@ -247,7 +248,7 @@ public static RespondActivityTaskCompletedByIDRequest respondActivityTaskComplet
}
RespondActivityTaskCompletedByIDRequest.Builder builder =
RespondActivityTaskCompletedByIDRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(TypeMapper.workflowRunPair(t.getWorkflowID(), t.getRunID()))
.setActivityId(t.getActivityID())
.setResult(payload(t.getResult()));
Expand Down Expand Up @@ -280,7 +281,7 @@ public static RespondActivityTaskFailedByIDRequest respondActivityTaskFailedById
}
RespondActivityTaskFailedByIDRequest.Builder builder =
RespondActivityTaskFailedByIDRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(TypeMapper.workflowRunPair(t.getWorkflowID(), t.getRunID()))
.setActivityId(t.getActivityID())
.setFailure(failure(t.getReason(), t.getDetails()));
Expand Down Expand Up @@ -384,7 +385,7 @@ public static ScanWorkflowExecutionsRequest scanWorkflowExecutionsRequest(
}
ScanWorkflowExecutionsRequest.Builder request =
ScanWorkflowExecutionsRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setPageSize(t.getPageSize());
if (t.getNextPageToken() != null) {
request.setNextPageToken(arrayToByteString(t.getNextPageToken()));
Expand All @@ -401,7 +402,7 @@ public static DescribeWorkflowExecutionRequest describeWorkflowExecutionRequest(
return null;
}
return DescribeWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getExecution()))
.setQueryConsistencyLevel(queryConsistencyLevel(t.getQueryConsistencyLevel()))
.build();
Expand All @@ -414,7 +415,7 @@ public static GetWorkflowExecutionHistoryRequest getWorkflowExecutionHistoryRequ
}
GetWorkflowExecutionHistoryRequest.Builder builder =
GetWorkflowExecutionHistoryRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getExecution()))
.setPageSize(t.getMaximumPageSize())
.setWaitForNewEvent(t.isWaitForNewEvent())
Expand All @@ -434,7 +435,7 @@ public static SignalWithStartWorkflowExecutionRequest signalWithStartWorkflowExe
}
StartWorkflowExecutionRequest.Builder builder =
StartWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowId(t.getWorkflowId())
.setWorkflowType(workflowType(t.getWorkflowType()))
.setTaskList(taskList(t.getTaskList()))
Expand Down Expand Up @@ -497,7 +498,7 @@ public static SignalWorkflowExecutionRequest signalWorkflowExecutionRequest(
}
SignalWorkflowExecutionRequest.Builder builder =
SignalWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getWorkflowExecution()))
.setSignalName(t.getSignalName())
.setSignalInput(payload(t.getInput()))
Expand All @@ -518,7 +519,7 @@ public static StartWorkflowExecutionRequest startWorkflowExecutionRequest(
}
StartWorkflowExecutionRequest.Builder request =
StartWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowId(t.getWorkflowId())
.setWorkflowType(workflowType(t.getWorkflowType()))
.setTaskList(taskList(t.getTaskList()))
Expand Down Expand Up @@ -566,7 +567,7 @@ public static TerminateWorkflowExecutionRequest terminateWorkflowExecutionReques
}
TerminateWorkflowExecutionRequest.Builder builder =
TerminateWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getWorkflowExecution()))
.setReason(t.getReason() != null ? t.getReason() : "")
.setDetails(payload(t.getDetails()));
Expand Down Expand Up @@ -622,7 +623,7 @@ public static ListTaskListPartitionsRequest listTaskListPartitionsRequest(
return null;
}
return ListTaskListPartitionsRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setTaskList(taskList(t.getTaskList()))
.build();
}
Expand All @@ -634,7 +635,7 @@ public static ListWorkflowExecutionsRequest listWorkflowExecutionsRequest(
}
ListWorkflowExecutionsRequest.Builder request =
ListWorkflowExecutionsRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setPageSize(t.getPageSize());
if (t.getNextPageToken() != null) {
request.setNextPageToken(arrayToByteString(t.getNextPageToken()));
Expand All @@ -652,7 +653,7 @@ public static PollForActivityTaskRequest pollForActivityTaskRequest(
}
PollForActivityTaskRequest.Builder builder =
PollForActivityTaskRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setTaskList(taskList(t.getTaskList()))
.setTaskListMetadata(taskListMetadata(t.getTaskListMetadata()));
if (t.getIdentity() != null) {
Expand All @@ -668,7 +669,7 @@ public static PollForDecisionTaskRequest pollForDecisionTaskRequest(
}
PollForDecisionTaskRequest.Builder builder =
PollForDecisionTaskRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setTaskList(taskList(t.getTaskList()));
if (t.getBinaryChecksum() != null) {
builder.setBinaryChecksum(t.getBinaryChecksum());
Expand All @@ -684,7 +685,7 @@ public static QueryWorkflowRequest queryWorkflowRequest(com.uber.cadence.QueryWo
return null;
}
return QueryWorkflowRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getExecution()))
.setQuery(workflowQuery(t.getQuery()))
.setQueryRejectCondition(queryRejectCondition(t.getQueryRejectCondition()))
Expand All @@ -699,7 +700,7 @@ public static RecordActivityTaskHeartbeatByIDRequest recordActivityTaskHeartbeat
}
RecordActivityTaskHeartbeatByIDRequest.Builder builder =
RecordActivityTaskHeartbeatByIDRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(TypeMapper.workflowRunPair(t.getWorkflowID(), t.getRunID()))
.setActivityId(t.getActivityID())
.setDetails(payload(t.getDetails()));
Expand Down Expand Up @@ -756,7 +757,7 @@ public static RestartWorkflowExecutionRequest restartWorkflowExecutionRequest(
return null;
}
return RestartWorkflowExecutionRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setWorkflowExecution(workflowExecution(t.getWorkflowExecution()))
.setReason(t.getReason() != null ? t.getReason() : "")
.setIdentity(t.getIdentity() != null ? t.getIdentity() : "")
Expand Down Expand Up @@ -852,7 +853,7 @@ public static ListClosedWorkflowExecutionsRequest listClosedWorkflowExecutionsRe
}
ListClosedWorkflowExecutionsRequest.Builder request =
ListClosedWorkflowExecutionsRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setPageSize(t.getMaximumPageSize());
if (t.getExecutionFilter() != null) {
request.setExecutionFilter(workflowExecutionFilter(t.getExecutionFilter()));
Expand All @@ -879,7 +880,7 @@ public static ListOpenWorkflowExecutionsRequest listOpenWorkflowExecutionsReques
}
ListOpenWorkflowExecutionsRequest.Builder request =
ListOpenWorkflowExecutionsRequest.newBuilder()
.setDomain(t.getDomain())
.setDomain(t.getDomain() != null ? t.getDomain() : "")
.setPageSize(t.getMaximumPageSize());
if (t.getExecutionFilter() != null) {
request.setExecutionFilter(workflowExecutionFilter(t.getExecutionFilter()));
Expand All @@ -903,7 +904,7 @@ public static RespondActivityTaskFailedByIDRequest respondActivityTaskFailedByID
}
RespondActivityTaskFailedByIDRequest.Builder request =
RespondActivityTaskFailedByIDRequest.newBuilder()
.setDomain(failRequest.getDomain())
.setDomain(failRequest.getDomain() != null ? failRequest.getDomain() : "")
.setWorkflowExecution(
TypeMapper.workflowRunPair(failRequest.getWorkflowID(), failRequest.getRunID()))
.setActivityId(failRequest.getActivityID())
Expand All @@ -919,7 +920,7 @@ public static RespondActivityTaskCompletedByIDRequest respondActivityTaskComplet
}
RespondActivityTaskCompletedByIDRequest.Builder request =
RespondActivityTaskCompletedByIDRequest.newBuilder()
.setDomain(completeRequest.getDomain())
.setDomain(completeRequest.getDomain() != null ? completeRequest.getDomain() : "")
.setWorkflowExecution(
TypeMapper.workflowRunPair(
completeRequest.getWorkflowID(), completeRequest.getRunID()))
Expand All @@ -937,7 +938,7 @@ public static RecordActivityTaskHeartbeatByIDRequest recordActivityTaskHeartbeat
}
RecordActivityTaskHeartbeatByIDRequest.Builder request =
RecordActivityTaskHeartbeatByIDRequest.newBuilder()
.setDomain(heartbeatRequest.getDomain())
.setDomain(heartbeatRequest.getDomain() != null ? heartbeatRequest.getDomain() : "")
.setWorkflowExecution(
TypeMapper.workflowRunPair(
heartbeatRequest.getWorkflowID(), heartbeatRequest.getRunID()))
Expand All @@ -955,7 +956,7 @@ public static RespondActivityTaskCanceledByIDRequest respondActivityTaskCanceled
}
RespondActivityTaskCanceledByIDRequest.Builder request =
RespondActivityTaskCanceledByIDRequest.newBuilder()
.setDomain(canceledRequest.getDomain())
.setDomain(canceledRequest.getDomain() != null ? canceledRequest.getDomain() : "")
.setWorkflowExecution(
TypeMapper.workflowRunPair(
canceledRequest.getWorkflowID(), canceledRequest.getRunID()))
Expand All @@ -972,7 +973,8 @@ public static GetTaskListsByDomainRequest getTaskListsByDomainRequest(
return null;
}
GetTaskListsByDomainRequest.Builder request =
GetTaskListsByDomainRequest.newBuilder().setDomain(domainRequest.getDomainName());
GetTaskListsByDomainRequest.newBuilder()
.setDomain(domainRequest.getDomainName() != null ? domainRequest.getDomainName() : "");
return request.build();
}

Expand All @@ -981,6 +983,8 @@ public static RefreshWorkflowTasksRequest refreshWorkflowTasksRequest(
if (request == null) {
return null;
}
return RefreshWorkflowTasksRequest.newBuilder().setDomain(request.getDomain()).build();
return RefreshWorkflowTasksRequest.newBuilder()
.setDomain(request.getDomain() != null ? request.getDomain() : "")
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ static WorkflowExecution workflowRunPair(String workflowId, String runId) {
if (Strings.isNullOrEmpty(workflowId) && Strings.isNullOrEmpty(runId)) {
return WorkflowExecution.newBuilder().build();
}
return WorkflowExecution.newBuilder().setWorkflowId(workflowId).setRunId(runId).build();
return WorkflowExecution.newBuilder()
.setWorkflowId(workflowId)
.setRunId(runId != null ? runId : "")
.build();
}

static ActivityType activityType(com.uber.cadence.ActivityType t) {
Expand Down Expand Up @@ -275,7 +278,7 @@ static WorkflowExecutionFilter workflowExecutionFilter(
}
return WorkflowExecutionFilter.newBuilder()
.setWorkflowId(t.getWorkflowId())
.setRunId(t.getRunId())
.setRunId(t.getRunId() != null ? t.getRunId() : "")
.build();
}

Expand Down