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

Commit

Permalink
identifierString() -> toShortString()
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindanr committed Mar 25, 2021
1 parent 5084409 commit 1d54e1e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public String toString() {
* A string representation of all relevant fields that identify this workflow.
* Intended for use in log and other system generated messages.
*/
public String identifierString() {
public String toShortString() {
return String.format("%s.%s/%s", getWorkflowName(), getWorkflowVersion(), workflowId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ private void updateAndPushParents(Workflow workflow) {
executionDAOFacade.updateTask(subWorkflowTask);

// add an execution log
String currentWorkflowIdentifier = workflow.identifierString();
String currentWorkflowIdentifier = workflow.toShortString();
workflowIdentifier = !workflowIdentifier.equals("") ? String.format("%s -> %s", currentWorkflowIdentifier, workflowIdentifier) : currentWorkflowIdentifier;
TaskExecLog log = new TaskExecLog(String.format("Workflow %s changed.", workflowIdentifier));
log.setTaskId(subWorkflowTask.getTaskId());
Expand Down Expand Up @@ -774,7 +774,7 @@ Workflow completeWorkflow(Workflow workflow) {

if (workflow.hasParent()) {
updateParentWorkflowTask(workflow);
LOGGER.info("{} updated parent {} task {}", workflow.identifierString(), workflow.getParentWorkflowId(), workflow.getParentWorkflowTaskId());
LOGGER.info("{} updated parent {} task {}", workflow.toShortString(), workflow.getParentWorkflowId(), workflow.getParentWorkflowTaskId());
queueDAO.pushIfNotExists(DECIDER_QUEUE, workflow.getParentWorkflowId(), properties.getSweepFrequency().getSeconds());
}

Expand Down Expand Up @@ -828,7 +828,7 @@ public Workflow terminateWorkflow(Workflow workflow, String reason, String failu

if (workflow.hasParent()) {
updateParentWorkflowTask(workflow);
LOGGER.info("{} updated parent {} task {}", workflow.identifierString(), workflow.getParentWorkflowId(), workflow.getParentWorkflowTaskId());
LOGGER.info("{} updated parent {} task {}", workflow.toShortString(), workflow.getParentWorkflowId(), workflow.getParentWorkflowTaskId());
queueDAO.pushIfNotExists(DECIDER_QUEUE, workflow.getParentWorkflowId(), properties.getSweepFrequency().getSeconds());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private void updateTaskStatus(Workflow subworkflow, Task task) {
task.getOutputData().putAll(subworkflow.getOutput());
}
if(!status.isSuccessful()) {
task.setReasonForIncompletion(String.format("Sub workflow %s failure reason: %s", subworkflow.identifierString(), subworkflow.getReasonForIncompletion()));
task.setReasonForIncompletion(String.format("Sub workflow %s failure reason: %s", subworkflow.toShortString(), subworkflow.getReasonForIncompletion()));
}
}
}
Expand Down

0 comments on commit 1d54e1e

Please sign in to comment.