function canDrop(element, target, position) {

  // can move labels everywhere
  if (isLabel(element) && !isConnection(target)) {
    return true;
  }

  // disallow to create elements on collapsed pools
  if (is(target, 'bpmn:Participant') && !isExpanded(target)) {
    return false;
  }

  // allow to create new participants on
  // on existing collaboration and process diagrams
  if (is(element, 'bpmn:Participant')) {
    return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
  }

  // allow creating lanes on participants and other lanes only
  if (is(element, 'bpmn:Lane')) {
    return is(target, 'bpmn:Participant') || is(target, 'bpmn:Lane');
  }

  if (is(element, 'bpmn:BoundaryEvent')) {
    return false;
  }

  // drop flow elements onto flow element containers
  // and participants
  if (is(element, 'bpmn:FlowElement')) {
    if (is(target, 'bpmn:FlowElementsContainer')) {
      return isExpanded(target);
    }

    return isAny(target, [ 'bpmn:Participant', 'bpmn:Lane' ]);
  }

  // account for the fact that data associations are always
  // rendered and moved to top (Process or Collaboration level)
  //
  // artifacts may be placed wherever, too
  if (isAny(element, [ 'bpmn:Artifact', 'bpmn:DataAssociation' ])) {
    return isAny(target, [
      'bpmn:Collaboration',
      'bpmn:Lane',
      'bpmn:Participant',
      'bpmn:Process',
      'bpmn:SubProcess' ]);
  }

  if (is(element, 'bpmn:MessageFlow')) {
    return is(target, 'bpmn:Collaboration')
      || element.source.parent == target
      || element.target.parent == target;
  }

  return false;
}
/**
 * Can an element be dropped into the target element
 *
 * @return {Boolean}
 */
Can an element be dropped into the target element
@return {Boolean}
Can an element be dropped into the target element @return { Boolean }
function canDrop(element, target, position) {
  if (isLabel(element) && !isConnection(target)) {
    return true;
  }
  if (is(target, 'bpmn:Participant') && !isExpanded(target)) {
    return false;
  }
  if (is(element, 'bpmn:Participant')) {
    return is(target, 'bpmn:Process') || is(target, 'bpmn:Collaboration');
  }
  if (is(element, 'bpmn:Lane')) {
    return is(target, 'bpmn:Participant') || is(target, 'bpmn:Lane');
  }
  if (is(element, 'bpmn:BoundaryEvent')) {
    return false;
  }
  if (is(element, 'bpmn:FlowElement')) {
    if (is(target, 'bpmn:FlowElementsContainer')) {
      return isExpanded(target);
    }
    return isAny(target, [ 'bpmn:Participant', 'bpmn:Lane' ]);
  }
   artifacts may be placed wherever, too
  if (isAny(element, [ 'bpmn:Artifact', 'bpmn:DataAssociation' ])) {
    return isAny(target, [
      'bpmn:Collaboration',
      'bpmn:Lane',
      'bpmn:Participant',
      'bpmn:Process',
      'bpmn:SubProcess' ]);
  }
  if (is(element, 'bpmn:MessageFlow')) {
    return is(target, 'bpmn:Collaboration')
      || element.source.parent == target
      || element.target.parent == target;
  }
  return false;
}
function canDrop ( element , target , position ) { if ( isLabel ( element ) && ! isConnection ( target ) ) { return true ; } if ( is ( target , 'bpmn:Participant' ) && ! isExpanded ( target ) ) { return false ; } if ( is ( element , 'bpmn:Participant' ) ) { return is ( target , 'bpmn:Process' ) || is ( target , 'bpmn:Collaboration' ) ; } if ( is ( element , 'bpmn:Lane' ) ) { return is ( target , 'bpmn:Participant' ) || is ( target , 'bpmn:Lane' ) ; } if ( is ( element , 'bpmn:BoundaryEvent' ) ) { return false ; } if ( is ( element , 'bpmn:FlowElement' ) ) { if ( is ( target , 'bpmn:FlowElementsContainer' ) ) { return isExpanded ( target ) ; } return isAny ( target , [ 'bpmn:Participant' , 'bpmn:Lane' ] ) ; } if ( isAny ( element , [ 'bpmn:Artifact' , 'bpmn:DataAssociation' ] ) ) { return isAny ( target , [ 'bpmn:Collaboration' , 'bpmn:Lane' , 'bpmn:Participant' , 'bpmn:Process' , 'bpmn:SubProcess' ] ) ; } if ( is ( element , 'bpmn:MessageFlow' ) ) { return is ( target , 'bpmn:Collaboration' ) || element . source . parent == target || element . target . parent == target ; } return false ; }
Can an element be dropped into the target element
 @return {Boolean}
Can an element be dropped into the target element @return { Boolean }
// can move labels everywhere // disallow to create elements on collapsed pools // allow to create new participants on // on existing collaboration and process diagrams // allow creating lanes on participants and other lanes only // drop flow elements onto flow element containers // and participants // account for the fact that data associations are always // rendered and moved to top (Process or Collaboration level) // // artifacts may be placed wherever, too