All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cloudfoundry.multiapps.controller.process.steps.PrepareToExecuteTasksStep Maven / Gradle / Ivy

There is a newer version: 1.183.0
Show newest version
package org.cloudfoundry.multiapps.controller.process.steps;

import java.text.MessageFormat;
import java.util.List;

import jakarta.inject.Named;

import org.cloudfoundry.multiapps.controller.process.Messages;
import org.cloudfoundry.multiapps.controller.process.variables.Variables;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;

import com.sap.cloudfoundry.client.facade.domain.CloudTask;

@Named("prepareToExecuteTasksStep")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class PrepareToExecuteTasksStep extends SyncFlowableStep {

    @Override
    protected StepPhase executeStep(ProcessContext context) {
        List tasksToExecute = context.getVariable(Variables.TASKS_TO_EXECUTE);
        context.setVariable(Variables.TASKS_COUNT, tasksToExecute.size());
        context.setVariable(Variables.TASKS_INDEX, 0);
        context.setVariable(Variables.INDEX_VARIABLE_NAME, Variables.TASKS_INDEX.getName());
        return StepPhase.DONE;
    }

    @Override
    protected String getStepErrorMessage(ProcessContext context) {
        return MessageFormat.format(Messages.ERROR_PREPARING_TO_EXECUTE_TASKS_ON_APP, context.getVariable(Variables.APP_TO_PROCESS)
                                                                                             .getName());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy