code: function(geometry) {
          var feature = new OpenLayers.Feature.Vector(geometry);
          var proceed = this.layer.events.triggerEvent(
              "sketchcomplete", {feature: feature}
          );
          if(proceed !== false) {
              feature.state = OpenLayers.State.INSERT;
              this.layer.addFeatures([feature]);
              this.featureAdded(feature);
              this.events.triggerEvent("featureadded",{feature : feature});
          }
      }
docs: Method: drawFeature