text: 'use strict';
  
  var ImplementationTypeHelper = require('../../../helper/ImplementationTypeHelper'),
      InputOutputHelper        = require('../../../helper/InputOutputHelper');
  
  var entryFactory            = require('../../../factory/EntryFactory'),
      cmdHelper               = require('../../../helper/CmdHelper');
  
  function getImplementationType(element) {
    return ImplementationTypeHelper.getImplementationType(element);
  }
  
  function getBusinessObject(element) {
    return ImplementationTypeHelper.getServiceTaskLikeBusinessObject(element);
  }
  
  function getConnector(bo) {
    return InputOutputHelper.getConnector(bo);
  }
  
  function isConnector(element) {
    return getImplementationType(element) === 'connector';
  }
  
  module.exports = function(group, element, bpmnFactory) {
  
    group.entries.push(entryFactory.textField({
      id: 'connectorId',
      label: 'Connector Id',
      modelProperty: 'connectorId',
  
      get: function(element, node) {
        var bo = getBusinessObject(element);
        var connector = bo && getConnector(bo);
        var value = connector && connector.get('connectorId');
        return { connectorId: value };
      },
  
      set: function(element, values, node) {
        var bo = getBusinessObject(element);
        var connector = getConnector(bo);
        return cmdHelper.updateBusinessObject(element, connector, {
          connectorId: values.connectorId || undefined
        });
      },
  
      validate: function(element, values, node) {
        return isConnector(element) && !values.connectorId ? { connectorId: 'Must provide a value'} : {};
      },
  
      disabled: function(element, node) {
        return !isConnector(element);
      }
  
    }));
  
  };
  