function generate()

in aws/hhvm1/state-machine/generate.hack [565:616]


function generate(): StateMachine {
  return linear_state_machine(
    null,
    dict[
      S::ParseInput => dict[
        F::Type => T::Task,
        F::ResultPath => '$',
      ],

      'Root' => dict[
        F::Type => T::Parallel,
        F::OutputPath => path('results', 'Root[0]'),
        F::Branches => vec[
          main_branch(),
          linear_state_machine(
            S::HealthCheck.S::End,
            dict[
              S::HealthCheck.T::Wait => dict[
                F::Type => T::Wait,
                F::Seconds => 300,
              ],
              S::HealthCheck => dict[
                F::Type => T::Task,
                F::Parameters => dict[
                  'buildInput.$' => '$.buildInput',
                  'execution.$' => '$$.Execution.Id',
                  'endState' => S::CheckIfReposChanged,
                ],
                F::ResultPath => path('shouldRepeat'),
              ],
              S::Should.S::HealthCheck => dict[
                F::Type => T::Choice,
                F::Choices => vec[
                  dict[
                    'Variable' => path('shouldRepeat'),
                    'BooleanEquals' => true,
                    'Next' => S::HealthCheck.T::Wait,
                  ],
                ],
                F::Default => S::HealthCheck.S::End,
              ],
              S::HealthCheck.S::End => dict[
                F::Type => T::Pass,
                F::End => true,
              ],
            ],
          ),
        ],
      ],
    ],
  );
}