 
 (defmethod user-msg :run [msg]
   (let [params (msg :params)
-        {:keys [ws eid phase]} params]
+        {:keys [ws user eid phase]} params]
     (infof "RUN: %s" params)
     (let [vmsg (va/validate-exp eid)]
       (if (not-empty vmsg)
         (send-end-msg ws {:op :validate :payload vmsg})
         (let [{:keys [cmd eid template]} params
-              ;;result (actions/action cmd eid params get-toolinfo template)
-              ]
+              dt (date-time-map)
+              resfut (actions/action cmd eid params get-toolinfo template)]
+          (aerial.utils.misc/sleep 250)
+          (swap! dbg (fn[M] (assoc M eid resfut)))
+          (infof "%s : %s" cmd resfut)
+          (update-jdb [user (dt :date) (dt :time)]
+                      {:action {:params params :template template}
+                       :result resfut})
+          (if (future-done? resfut)
+            (let [cause (->> @resfut (austr/split #">>") second
+                             (str "Launch Failed: "))]
+              (srv/send-msg ws {:op :error :payload cause}))
+            (srv/send-msg ws {:op :launch :payload "Successful"}))
           (srv/send-msg ws {:op :stop :payload {}} :noenvelope true))))))
 
 (defn msg-handler [msg]

  ([key-path] (hc/get-db app-db key-path)))




;;; ------------------------------------------------------------------------;;;
;;;                   Aerobio Application Messaging...                      ;;;
;;; ------------------------------------------------------------------------;;;

(defn send-end-msg [ws msg]
  (srv/send-msg ws msg)
  (srv/send-msg ws {:op :stop :payload {}} :noenvelope true))

(defmulti user-msg :op)





(defn date-time-map []
  (let [dt (->> (java.time.LocalDateTime/now) str (austr/split #"T")
                (mapv #(vector %1 %2) [:date :time]) (into {}))
        time (->> dt :time (austr/split #":")
                  (mapv #(vector %1 %2) [:hour :min :sec]) (into {}))
        dt (assoc dt :time-bits time)]
    dt))

;;; ------------------------------------------------------------------------;;;
;;;                    Tool Config and  Watcher                             ;;;
;;; ------------------------------------------------------------------------;;;
