def process_step_function()

in source/Main_Orchestrator.py [0:0]


def process_step_function(StateMachineArn,AmsChangeTypeId,pausetime,appaccountid,exec_params,app_acct_role):
    try:
        # assign a random number to the step function execution to allow for multiple calls
        exec_random_string= random.randint(0, 100000)
        local_stepfunction_session = boto3.session.Session()
        client = local_stepfunction_session.client('stepfunctions')
        # initialize the execution of the step function
        response = client.start_execution(
            stateMachineArn=str(StateMachineArn),
            name=AmsChangeTypeId +"_"+ str(exec_random_string),
            input= str("{\"wait_time\":" + str(pausetime) + ",\"change_type_id\":" + "\""+ AmsChangeTypeId + "\",\"app_account_id\":" + "\""+ appaccountid + "\",\"exec_params\":" + "\""+ exec_params  + "\",\"app_acct_role\":" + "\""+ app_acct_role +"\""+ "}")
        )
        return (str(response))
    except Exception as step_function_failure:
        print("Failed to execute step function for" + StateMachineArn + " " + str(step_function_failure))