Skip to content

Commit

Permalink
Merge pull request #72 from orkes-io/clean-repo
Browse files Browse the repository at this point in the history
Removed unused code
  • Loading branch information
v1r3n authored Jan 19, 2023
2 parents 71fd6a3 + b6ca448 commit a631564
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 84 deletions.
47 changes: 0 additions & 47 deletions src/main/java/io/orkes/conductor/client/model/TargetRef.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,7 @@
* The object over which access is being granted or removed
*/
@Schema(description = "The object over which access is being granted or removed")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2023-01-18T16:50:52.109134-03:00[America/Sao_Paulo]")
public class TargetRef {
/**
* Gets or Sets id
*/
@JsonAdapter(IdEnum.Adapter.class)
public enum IdEnum {
IDENTIFIER_OF_THE_TARGET_E_G_NAME_IN_CASE_IT_S_A_WORKFLOW_DEF(
"Identifier of the target e.g. `name` in case it's a WORKFLOW_DEF");

private String value;

IdEnum(String value) {
this.value = value;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

public static IdEnum fromValue(String input) {
for (IdEnum b : IdEnum.values()) {
if (b.value.equals(input)) {
return b;
}
}
return null;
}

public static class Adapter extends TypeAdapter<IdEnum> {
@Override
public void write(final JsonWriter jsonWriter, final IdEnum enumeration) throws IOException {
jsonWriter.value(String.valueOf(enumeration.getValue()));
}

@Override
public IdEnum read(final JsonReader jsonReader) throws IOException {
Object value = jsonReader.nextString();
return IdEnum.fromValue((String) (value));
}
}
}

@SerializedName("id")
private String id = null;

Expand Down
14 changes: 2 additions & 12 deletions src/test/java/io/orkes/conductor/client/WorkflowRetryExamples.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,10 @@ public void testRetry() {
failTask(workflow.getWorkflowId(), taskId);
workflow = workflowClient.getWorkflow(workflowId, true);

taskId = workflow.getTasks().get(1).getTaskId();
failTask(workflow.getWorkflowId(), taskId);
workflow = workflowClient.getWorkflow(workflowId, true);

taskId = workflow.getTasks().get(2).getTaskId();
failTask(workflow.getWorkflowId(), taskId);
workflow = workflowClient.getWorkflow(workflowId, true);

taskId = workflow.getTasks().get(3).getTaskId();
failTask(workflow.getWorkflowId(), taskId);
workflow = workflowClient.getWorkflow(workflowId, true);

// Upload all the workflows to s3
workflowClient.uploadCompletedWorkflows();

workflowClient.terminateWorkflow(workflowId, "testing out some stuff");
// Retry the workflow

System.out.println("Going to retry " + workflowId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import com.netflix.conductor.common.metadata.tasks.TaskDef;
import com.netflix.conductor.common.metadata.tasks.TaskType;
import com.netflix.conductor.common.metadata.workflow.WorkflowDef;
import com.netflix.conductor.common.metadata.workflow.WorkflowTask;

import io.orkes.conductor.client.*;
import io.orkes.conductor.client.http.*;
import io.orkes.conductor.client.model.*;
Expand Down Expand Up @@ -99,23 +93,4 @@ UpsertGroupRequest getUpsertGroupRequest() {
.roles(List.of(UpsertGroupRequest.RolesEnum.USER));
}

private void registerWorkflowDef(String workflowName, String taskName, MetadataClient metadataClient1) {
TaskDef taskDef = new TaskDef(taskName);
taskDef.setOwnerEmail("[email protected]");
WorkflowTask workflowTask = new WorkflowTask();
workflowTask.setTaskReferenceName(taskName);
workflowTask.setName(taskName);
workflowTask.setTaskDefinition(taskDef);
workflowTask.setWorkflowTaskType(TaskType.SIMPLE);
workflowTask.setInputParameters(Map.of("value", "${workflow.input.value}", "order", "123"));
WorkflowDef workflowDef = new WorkflowDef();
workflowDef.setName(workflowName);
workflowDef.setOwnerEmail("[email protected]");
workflowDef.setInputParameters(Arrays.asList("value", "inlineValue"));
workflowDef.setDescription("Workflow to monitor order state");
workflowDef.setTasks(Arrays.asList(workflowTask));
metadataClient1.registerWorkflowDef(workflowDef);
metadataClient1.registerTaskDefs(Arrays.asList(taskDef));
}

}

0 comments on commit a631564

Please sign in to comment.