(function (module) {
    module.component('mcProjectProcesses', {
        templateUrl: 'components/project/processes/mc-project-processes.html',
        controller: 'MCProjectProcessesComponentController'
    });

    module.controller('MCProjectProcessesComponentController', MCProjectProcessesComponentController);
    MCProjectProcessesComponentController.$inject = ["project", "$stateParams"];
    function MCProjectProcessesComponentController(project, $stateParams) {
        var ctrl = this;

        ctrl.processes = project.get().processes;

        ///////////////////////////
    }
}(angular.module('materialscommons')));

(function (module) {
    module.component('mcProjectProcesses', {
        templateUrl: 'components/project/processes/mc-project-processes.html',
        controller: 'MCProjectProcessesComponentController'
    });

    module.controller('MCProjectProcessesComponentController', MCProjectProcessesComponentController);
    MCProjectProcessesComponentController.$inject = ['project', '$stateParams', '$state', '$filter'];
    function MCProjectProcessesComponentController(project, $stateParams, $state, $filter) {
        var ctrl = this;

        ctrl.processes = project.get().processes;

        if (!$stateParams.process_id && ctrl.processes.length) {
            ctrl.processes = $filter('orderBy')(ctrl.processes, 'name');
            var firstProcess = ctrl.processes[0];
            $state.go('project.processes.process', {process_id: firstProcess.id});
        }

        ///////////////////////////
    }
}(angular.module('materialscommons')));

Sort processes and if there is no process id go to the first one.
Sort processes and if there is no process id go to the first one.
