Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
remove old complex workflow and replace it with master Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardW98 authored and openshift-merge-robot committed Mar 17, 2023
1 parent 92ef01d commit 2975c51
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 282 deletions.
2 changes: 1 addition & 1 deletion workflow-examples/run_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ run_escalation_flow() {
}' | jq -r '.workFlowExecutionId')"

echo " "
echo "******** Simple Esalation Flow Completed (check logs as the checkers are still running) ********"
echo "******** Simple Escalation Flow Completed (check logs as the checkers are still running) ********"
echo " "
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package com.redhat.parodos.examples.master;

import com.redhat.parodos.examples.master.checker.NamespaceApprovalWorkFlowCheckerTask;
import com.redhat.parodos.examples.master.checker.SslCertificationApprovalWorkFlowCheckerTask;
import com.redhat.parodos.examples.master.task.AdGroupsWorkFlowTask;
import com.redhat.parodos.examples.master.task.LoadBalancerWorkFlowTask;
import com.redhat.parodos.examples.master.task.NamespaceWorkFlowTask;
import com.redhat.parodos.examples.master.task.OnboardingAssessmentTask;
import com.redhat.parodos.examples.master.task.SingleSignOnWorkFlowTask;
import com.redhat.parodos.examples.master.task.SplunkMonitoringWorkFlowTask;
import com.redhat.parodos.examples.master.task.SslCertificationWorkFlowTask;
import com.redhat.parodos.examples.master.checker.NamespaceApprovalWorkFlowCheckerTask;
import com.redhat.parodos.examples.master.checker.SslCertificationApprovalWorkFlowCheckerTask;
import com.redhat.parodos.workflow.annotation.Assessment;
import com.redhat.parodos.workflow.annotation.Checker;
import com.redhat.parodos.workflow.annotation.Infrastructure;
import com.redhat.parodos.workflow.annotation.Parameter;
import com.redhat.parodos.workflow.consts.WorkFlowConstants;
import com.redhat.parodos.workflow.option.WorkFlowOption;
import com.redhat.parodos.workflow.parameter.WorkFlowParameterType;
import com.redhat.parodos.workflows.workflow.ParallelFlow;
import com.redhat.parodos.workflows.workflow.SequentialFlow;
Expand All @@ -24,6 +28,35 @@
@Configuration
public class MasterWorkFlowConfiguration {

// Assessment workflow
@Bean
WorkFlowOption onboardingOption() {
return new WorkFlowOption.Builder("onboardingOption", "masterWorkFlow")
.addToDetails("An example workflow option of a complex master WorkFlow with Status checks")
.displayName("Onboarding").setDescription("An example of a complex WorkFlow").build();
}

// An AssessmentTask returns one or more WorkFlowOption wrapped in a WorkflowOptions
@Bean
OnboardingAssessmentTask onboardingAssessmentTask(
@Qualifier("onboardingOption") WorkFlowOption awesomeToolsOption) {
return new OnboardingAssessmentTask(awesomeToolsOption);
}

// A Workflow designed to execute and return WorkflowOption(s) that can be executed
// next. In this case there is only one.
@Bean(name = "onboardingAssessment" + WorkFlowConstants.ASSESSMENT_WORKFLOW)
@Assessment
WorkFlow assessmentWorkFlow(
@Qualifier("onboardingAssessmentTask") OnboardingAssessmentTask onboardingAssessmentTask) {
// @formatter:off
return SequentialFlow.Builder.aNewSequentialFlow()
.named("onboardingAssessment" + WorkFlowConstants.ASSESSMENT_WORKFLOW)
.execute(onboardingAssessmentTask)
.build();
// @formatter:on
}

// SUB WORKFLOW ONE:
// Parallel Flow:
// - AdGroupsWorkFlowTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.redhat.parodos.examples.master.checker;

import com.redhat.parodos.workflow.task.enums.WorkFlowTaskOutput;
import com.redhat.parodos.workflows.work.WorkStatus;
import com.redhat.parodos.workflow.task.checker.BaseWorkFlowCheckerTask;
import com.redhat.parodos.workflow.task.enums.WorkFlowTaskOutput;
import com.redhat.parodos.workflow.task.parameter.WorkFlowTaskParameter;
import com.redhat.parodos.workflows.work.DefaultWorkReport;
import com.redhat.parodos.workflows.work.WorkContext;
import com.redhat.parodos.workflows.work.WorkReport;
import com.redhat.parodos.workflows.work.WorkStatus;
import lombok.extern.slf4j.Slf4j;

import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.redhat.parodos.examples.complex.task;
package com.redhat.parodos.examples.master.task;

import com.redhat.parodos.workflow.context.WorkContextDelegate;
import com.redhat.parodos.workflow.option.WorkFlowOption;
import com.redhat.parodos.workflow.option.WorkFlowOptions;
import com.redhat.parodos.workflow.task.enums.WorkFlowTaskOutput;
import com.redhat.parodos.workflow.task.assessment.BaseAssessmentTask;
import com.redhat.parodos.workflow.task.enums.WorkFlowTaskOutput;
import com.redhat.parodos.workflow.task.parameter.WorkFlowTaskParameter;
import com.redhat.parodos.workflow.task.parameter.WorkFlowTaskParameterType;
import com.redhat.parodos.workflows.work.DefaultWorkReport;
import com.redhat.parodos.workflows.work.WorkContext;
import com.redhat.parodos.workflows.work.WorkReport;
import com.redhat.parodos.workflows.work.WorkStatus;

import java.util.Collections;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public WorkReport execute(WorkContext workContext) {
catch (Exception e) {
log.error("There was an issue with the task {}: {}", getName(), e.getMessage());
}
return new DefaultWorkReport(WorkStatus.COMPLETED, workContext);
return new DefaultWorkReport(WorkStatus.FAILED, workContext);
}

@Override
Expand Down
Loading

0 comments on commit 2975c51

Please sign in to comment.