function WorkloadController($scope, ExecutionHelperService, Workload) {

        $scope.taskType = 'file';
        $scope.sequenceStart = 0;
        $scope.sequenceStop = 100;
        $scope.providers = [];
        $scope.file = {};
        $scope.description = '';

        $scope.readContents = function readContents($contents) {
            $scope.file.contents = $contents;
        };

        $scope.createWorkload = function createWorkload() {
            if ($scope.newTask.$invalid)
                return;

            var task = $scope.taskType == 'file' ?
                $scope.file.contents : $scope.taskText;

            if (!task)
                return;

            var workload = new Workload();

            workload.setFromJson({
                task: task,
                sequence_start: $scope.sequenceStart,
                sequence_stop: $scope.sequenceStop,
                description: $scope.description
            });

            workload.save(function () {
                $scope.setWorkload(workload);
            });
        };

        $scope.setWorkload = function setWorkload(workload) {
            ExecutionHelperService.setWorkload(workload);
            ExecutionHelperService.doNextStep();
        };

        Workload.getAll(function (workloads) {
            $scope.workloads = workloads;

            if ($scope.workloads && $scope.workloads.length) {
                $scope.selectTask = $scope.workloads[0];
            }
        });

    }
/**
     * @namespace WorkloadController
     * @desc Controller for the workload view
     * @memberOf Views
     */
@namespace WorkloadController
@desc Controller for the workload view
@memberOf Views
@namespace WorkloadController @desc Controller for the workload view @memberOf Views
function WorkloadController($scope, ExecutionHelperService, Workload) {
        $scope.taskType = 'file';
        $scope.sequenceStart = 0;
        $scope.sequenceStop = 100;
        $scope.providers = [];
        $scope.file = {};
        $scope.description = '';
        $scope.readContents = function readContents($contents) {
            $scope.file.contents = $contents;
        };
        $scope.createWorkload = function createWorkload() {
            if ($scope.newTask.$invalid)
                return;
            var task = $scope.taskType == 'file' ?
                $scope.file.contents : $scope.taskText;
            if (!task)
                return;
            var workload = new Workload();
            workload.setFromJson({
                task: task,
                sequence_start: $scope.sequenceStart,
                sequence_stop: $scope.sequenceStop,
                description: $scope.description
            });
            workload.save(function () {
                $scope.setWorkload(workload);
            });
        };
        $scope.setWorkload = function setWorkload(workload) {
            ExecutionHelperService.setWorkload(workload);
            ExecutionHelperService.doNextStep();
        };
        Workload.getAll(function (workloads) {
            $scope.workloads = workloads;
            if ($scope.workloads && $scope.workloads.length) {
                $scope.selectTask = $scope.workloads[0];
            }
        });
    }
function WorkloadController ( $scope , ExecutionHelperService , Workload ) { $scope . taskType = 'file' ; $scope . sequenceStart = 0 ; $scope . sequenceStop = 100 ; $scope . providers = [ ] ; $scope . file = { } ; $scope . description = '' ; $scope . readContents = function readContents ( $contents ) { $scope . file . contents = $contents ; } ; $scope . createWorkload = function createWorkload ( ) { if ( $scope . newTask . $invalid ) return ; var task = $scope . taskType == 'file' ? $scope . file . contents : $scope . taskText ; if ( ! task ) return ; var workload = new Workload ( ) ; workload . setFromJson ( { task : task , sequence_start : $scope . sequenceStart , sequence_stop : $scope . sequenceStop , description : $scope . description } ) ; workload . save ( function ( ) { $scope . setWorkload ( workload ) ; } ) ; } ; $scope . setWorkload = function setWorkload ( workload ) { ExecutionHelperService . setWorkload ( workload ) ; ExecutionHelperService . doNextStep ( ) ; } ; Workload . getAll ( function ( workloads ) { $scope . workloads = workloads ; if ( $scope . workloads && $scope . workloads . length ) { $scope . selectTask = $scope . workloads [ 0 ] ; } } ) ; }
@namespace WorkloadController
 @desc Controller for the workload view
 @memberOf Views
@namespace WorkloadController @desc Controller for the workload view @memberOf Views