         }
       GenServer.cast(self(), :continue) # yields execution of actions.
 
-      #Logger.info("Trigger! #{inspect params} #{inspect state}")
+      # Logger.info("Trigger! #{inspect params} #{inspect state}")
       #{:ok, rule_final_state} = execute_actions(uuid, state.rule.rule["actions"], trigger_state)
       #Logger.info("Final state: #{inspect rule_final_state}")
 

  end
  def handle_call({:trigger, params}, from, state) do
    if state.signal_end_of_trigger do
      {:reply, {:error, :already_running}, state}
    else
      GenServer.cast(self(), {:trigger, params})
      {:noreply, %{ state | signal_end_of_trigger: from }}

      Logger.debug("Run action #{inspect action} #{inspect params}\n #{inspect state, pretty: true}")
    end

    # Logger.debug("Do trigger wait")
    result = Serverboards.Action.trigger_wait(action, params, "rule/#{uuid}")

    # Logger.info("Executed action #{inspect action}", rule_uuid: uuid, params: params)

    result = if Enum.count(result)==1 and Map.has_key?(result, :result) do
      result[:result] else result end
