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

plugin-webapp.acm-plugin.app.services.utilService.js Maven / Gradle / Ivy

Go to download

This plugin provides information about case definitions and case instances deployed into Camunda BPM. It seamless integrates into Cockpit in the same way, as the corresponding process definition/instance pages.

There is a newer version: 1.1
Show newest version
ngDefine('cockpit.plugin.acm-plugin.services', function(module) {

  module.factory('utilService', function() {
    'use strict';

    return {

      variableArrayToObject : function(variablesArray) {

        var variablesResult = {};

        // convert to Camunda format

        for (var i = 0; i < variablesArray.length; i++) {
          var value = {};
          Object.defineProperty(value, 'value', {
            enumerable : true,
            writeable : true,
            configurable : true,
            value : variablesArray[i].value
          });
          Object.defineProperty(value, 'type', {
            enumerable : true,
            writeable : true,
            configurable : true,
            value : variablesArray[i].type
          });
          Object.defineProperty(variablesResult, variablesArray[i].name, {
            enumerable : true,
            writeable : true,
            configurable : true,
            value : value
          });
        }
        return variablesResult;
      },

      addVariableTypeString : function(variables) {
        for ( var v in variables) {
        if (!variables[v].hasOwnProperty('type')) {
          Object.defineProperty(variables[v], 'type', {
            enumerable : true,
            writeable : true,
            configurable : true,
            value : 'String'
          });
        }
      }
        return variables;
      }
    };

  });
  
});




© 2015 - 2025 Weber Informatics LLC | Privacy Policy