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

tgtools.activiti.resource.editor-app.configuration.properties-sequenceflow-order-controller.js Maven / Gradle / Ivy

There is a newer version: 5.22.0.8
Show newest version
/*
 * Activiti Modeler component part of the Activiti project
 * Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

/*
 * Sequence flow order controller
 */

var KisBpmSequenceFlowOrderCtrl = [ '$scope', '$modal', '$timeout', '$translate', function($scope, $modal, $timeout, $translate) {

    // Config for the modal window
    var opts = {
        template:  'editor-app/configuration/properties/sequenceflow-order-popup.html?version=' + Date.now(),
        scope: $scope
    };

    $modal(opts);
}];

var KisBpmSequenceFlowOrderPopupCtrl = ['$scope', '$translate', function($scope, $translate) {

    // Find the outgoing sequence flow of the current selected shape
    var outgoingSequenceFlow = [];
    var selectedShape = $scope.selectedShape;
    if (selectedShape) {
        var outgoingNodes = selectedShape.getOutgoingShapes();
        for (var i=0; i 0) {
            $scope.property.value = {};
            $scope.property.value.sequenceFlowOrder = [];

            for (var flowIndex=0; flowIndex < $scope.outgoingSequenceFlow.length; flowIndex++) {
                $scope.property.value.sequenceFlowOrder.push($scope.outgoingSequenceFlow[flowIndex].id);
            }
        } else {
            $scope.property.value = null;
        }

        $scope.updatePropertyInModel($scope.property);
        $scope.close();
    };

    // Cancel click handler
    $scope.cancel = function() {
        $scope.close();
    };

    // Close button handler
    $scope.close = function() {
        $scope.property.mode = 'read';
        $scope.$hide();
    };

}];




© 2015 - 2024 Weber Informatics LLC | Privacy Policy