/// class PD.Manage.Modules.ObjectModel.ProcessCreateDialogCommand

PD.Manage.Modules.ObjectModel.ProcessCreateDialogCommand =
PD.Commands.Command.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {

        this.props("id", "process/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("PLUS.PNG"));
        this.props("label", "New");
        this.props("tooltip", "Create a new Process.");

    },

    execute: function (e) {
        this._super(e);
        this._showDialog();
    },

    //===================================
    // PRIVATE METHODS
    //===================================

    _showDialog: function () {

        PDJS.Shared.Features.FeatureDialogForNhib.open({
            title: "Create | Process",
            args: {
                targetType: "ProspectDirector.Web.Shared.Modules.Process.ProcessUIO",
                arbiterType: "ProspectDirector.Web.Manage.Modules.Process.ProcessArbiter"
            },
            callbacks: {
                "ok": (sender, data) => {
                    PD.context
                        .get_default()
                        .get_events()
                        .publish("process/create", {
                            id: e.id
                        });
                }
            }
        });


    }

});