openhab-scripting 4.27.0 → 4.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16eb15617a1a088c561a6d12e1f6e2ba39459491c9e831933ff235d3177ba225
4
- data.tar.gz: 40f21e9e4bb53c04f1bd9e4ee51b834756783218584f05728e26860eb95d491c
3
+ metadata.gz: 7c9d9745b2590c4152baf18a82dbe0063ac4c73c94f6f452d9d848790d8eb06a
4
+ data.tar.gz: 276152f1a79cf44fb539f4bb0c73618263db8d4a944cf367fa0ef1db167d989a
5
5
  SHA512:
6
- metadata.gz: ac79f5e48d51ec69530c88fe05541e3c6051df205858371a5f450a226d680940058023cab20df0037c148293f60e9b85e20768669c48657ead01ee828097a16a
7
- data.tar.gz: e8b218bdd0ecedbb3910c9859bb43e8f06c5372ffc7aa94a6fae0abe7f5defeff8d3a3f6fdee1af9337e8a2684ea2ce194d9e09344f5144650c38b1e91c9f9ea
6
+ metadata.gz: d66efa237735b6a754e97eb933a301cb5dd639fa7cc715fa7d36c3e6f7ed14c11a3da874ea707792cb0913bb9e57396b33532746b7a63b08acf50ff15d4fc9f0
7
+ data.tar.gz: b2fcbb63e5e9da86909dd7b7b2bcb054b29aea1b80ae59fb26555a7aa678a7f4ebe04ee36dda69413c7cc8fbe08c7beeeaa5ad333e09d4bac08bbe2b769e85e7
@@ -53,7 +53,11 @@ module OpenHAB
53
53
  # sending the command
54
54
  def command(command)
55
55
  return super unless Thread.current[:ensure_states]
56
- return if command == state
56
+
57
+ logger.trace do
58
+ "#{name} ensure #{command}, format_type_pre: #{format_type_pre(command)}, current state: #{state}"
59
+ end
60
+ return if state == format_type_pre(command)
57
61
 
58
62
  super
59
63
  end
@@ -135,7 +135,7 @@ module OpenHAB
135
135
  # @return [Array<Group>] All groups that this item is part of
136
136
  #
137
137
  def groups
138
- group_names.map { |name| Groups.groups[name] }
138
+ group_names.map { |name| Groups.groups[name] }.compact
139
139
  end
140
140
 
141
141
  # Return the item's thing if this item is linked with a thing. If an item is linked to more than one thing,
@@ -304,7 +304,7 @@ module OpenHAB
304
304
  end
305
305
  false
306
306
  rescue StandardError => e
307
- print_backtrace(e)
307
+ logger.log_exception(e, name)
308
308
  end
309
309
  # rubocop:enable Metrics/MethodLength
310
310
 
@@ -328,7 +328,7 @@ module OpenHAB
328
328
  end
329
329
  end
330
330
  rescue StandardError => e
331
- print_backtrace(e)
331
+ logger.log_exception(e, name)
332
332
  end
333
333
 
334
334
  #
@@ -399,16 +399,6 @@ module OpenHAB
399
399
  @run_context.instance_exec(event, &task.block)
400
400
  end
401
401
 
402
- #
403
- # Print error and stack trace without calls to internal classes
404
- #
405
- # @param [Exception] error A rescued error
406
- #
407
- def print_backtrace(error)
408
- error = logger.clean_backtrace(error)
409
- logger.error { "#{error.message} (#{error.class})\nIn rule: #{name}\n#{error.backtrace&.join("\n")}" }
410
- end
411
-
412
402
  #
413
403
  # Create a new hash in which all elements are converted to strings
414
404
  #
@@ -5,7 +5,6 @@ require 'openhab/core/services'
5
5
  require 'openhab/log/logger'
6
6
  require_relative 'rule_config'
7
7
  require_relative 'automation_rule'
8
- require_relative 'cron_trigger_rule'
9
8
  require_relative 'guard'
10
9
 
11
10
  module OpenHAB
@@ -26,7 +25,7 @@ module OpenHAB
26
25
  @registry = OpenHAB::Core.rule_registry
27
26
  class << self
28
27
  attr_reader :script_rules, :automation_manager, :registry
29
- end
28
+ end
30
29
 
31
30
  #
32
31
  # Create a new rule
@@ -35,7 +34,7 @@ end
35
34
  # @yield [] Block executed in context of a RuleConfig
36
35
  #
37
36
  #
38
- # rubocop: disable Metrics
37
+ # rubocop: disable Metrics/MethodLength
39
38
  def rule(rule_name, &block)
40
39
  thread_local(RULE_NAME: rule_name) do
41
40
  @rule_name = rule_name
@@ -47,10 +46,9 @@ end
47
46
  nil # Must return something other than the rule object. See https://github.com/boc-tothefuture/openhab-jruby/issues/438
48
47
  end
49
48
  rescue StandardError => e
50
- puts "#{e.class}: #{e.message}"
51
- re_raise_with_backtrace(e)
49
+ logger.log_exception(e, @rule_name)
52
50
  end
53
- # rubocop: enable Metrics
51
+ # rubocop: enable Metrics/MethodLength
54
52
 
55
53
  #
56
54
  # Cleanup rules in this script file
@@ -62,16 +60,6 @@ end
62
60
 
63
61
  private
64
62
 
65
- #
66
- # Re-raises a rescued error to OpenHAB with added rule name and stack trace
67
- #
68
- # @param [Exception] error A rescued error
69
- #
70
- def re_raise_with_backtrace(error)
71
- error = logger.clean_backtrace(error)
72
- raise error, "#{error.message}\nIn rule: #{@rule_name}\n#{error.backtrace.join("\n")}"
73
- end
74
-
75
63
  #
76
64
  # Process a rule based on the supplied configuration
77
65
  #
@@ -81,44 +69,14 @@ end
81
69
  def process_rule_config(config)
82
70
  return unless create_rule?(config)
83
71
 
84
- cron_attach_triggers, other_triggers = partition_triggers(config)
85
- logger.trace("Cron triggers: #{cron_attach_triggers} - Other triggers: #{other_triggers}")
86
- config.triggers = other_triggers
87
-
88
72
  rule = AutomationRule.new(config: config)
89
73
  Rules.script_rules << rule
90
74
  add_rule(rule)
91
75
 
92
- process_cron_attach(cron_attach_triggers, config, rule)
93
-
94
76
  rule.execute(nil, { 'event' => Struct.new(:attachment).new(config.start_attachment) }) if config.on_start?
95
77
  rule
96
78
  end
97
79
 
98
- #
99
- # Add cron triggers with attachments to rules
100
- # @param [Array] cron_attach_triggers cron type triggers with attachments
101
- #
102
- def process_cron_attach(cron_attach_triggers, config, rule)
103
- cron_attach_triggers&.map { |trigger| CronTriggerRule.new(rule_config: config, rule: rule, trigger: trigger) }
104
- &.each { |trigger| add_rule(trigger) }
105
- end
106
-
107
- #
108
- # Partitions triggers in a config, removing cron triggers with a corresponding attachment
109
- # so they can be used with CronTriggerRules to support attachments
110
- # @return [Array] Two element array the first element is cron triggers with attachments,
111
- # second element is other triggers
112
- #
113
- def partition_triggers(config)
114
- config
115
- .triggers
116
- .partition do |trigger|
117
- trigger.typeUID == OpenHAB::DSL::Rules::Triggers::Trigger::CRON &&
118
- config.attachments.key?(trigger.id)
119
- end
120
- end
121
-
122
80
  #
123
81
  # Should a rule be created based on rule configuration
124
82
  #
@@ -164,7 +164,125 @@ module OpenHAB
164
164
  end
165
165
  expression_map
166
166
  end
167
+
168
+ #
169
+ # Cron trigger that provides trigger ID
170
+ #
171
+ module Cron
172
+ include OpenHAB::Log
173
+
174
+ #
175
+ # Creates trigger types and trigger type factories for OpenHAB
176
+ #
177
+ def self.add_script_cron_handler
178
+ java_import org.openhab.core.automation.type.TriggerType
179
+ OpenHAB::Core.automation_manager.add_trigger_handler(
180
+ OpenHAB::DSL::Rules::Triggers::Cron::CRON_TRIGGER_MODULE_ID,
181
+ OpenHAB::DSL::Rules::Triggers::Cron::CronTriggerHandlerFactory.new
182
+ )
183
+
184
+ OpenHAB::Core.automation_manager.add_trigger_type(cron_trigger_type)
185
+ OpenHAB::Log.logger(self).trace('Added script cron trigger handler')
186
+ end
187
+
188
+ #
189
+ # Creates trigger types and trigger type factories for OpenHAB
190
+ #
191
+ private_class_method def self.cron_trigger_type
192
+ TriggerType.new(
193
+ OpenHAB::DSL::Rules::Triggers::Cron::CRON_TRIGGER_MODULE_ID,
194
+ nil,
195
+ 'A specific instant occurs',
196
+ 'Triggers when the specified instant occurs',
197
+ nil,
198
+ org.openhab.core.automation.Visibility::VISIBLE,
199
+ nil
200
+ )
201
+ end
202
+
203
+ # Trigger ID for Watch Triggers
204
+ CRON_TRIGGER_MODULE_ID = 'jsr223.jruby.CronTrigger'
205
+
206
+ # Cron Trigger Handler that provides trigger IDs
207
+ # Unfortunatly because the CronTriggerHandler in OpenHAB core is marked internal
208
+ # the entire thing must be recreated here
209
+ class CronTriggerHandler < org.openhab.core.automation.handler.BaseTriggerModuleHandler
210
+ include OpenHAB::Log
211
+ include org.openhab.core.scheduler.SchedulerRunnable
212
+ include org.openhab.core.automation.handler.TimeBasedTriggerHandler
213
+
214
+ # Provides access to protected fields
215
+ field_accessor :callback
216
+
217
+ # Creates a new CronTriggerHandler
218
+ # @param [Trigger] OpenHAB trigger associated with handler
219
+ #
220
+ def initialize(trigger)
221
+ @trigger = trigger
222
+ @scheduler = OpenHAB::Core::OSGI.service('org.openhab.core.scheduler.CronScheduler')
223
+ @expression = trigger.configuration.get('cronExpression')
224
+ super(trigger)
225
+ end
226
+
227
+ #
228
+ # Set the callback to execute when cron trigger fires
229
+ # @param [Object] callback to run
230
+ #
231
+ def setCallback(callback) # rubocop:disable Naming/MethodName
232
+ synchronized do
233
+ super(callback)
234
+ @scheduler.schedule(self, @expression)
235
+ logger.trace("Scheduled cron job '#{@expression}' for trigger '#{@trigger.id}'.")
236
+ end
237
+ end
238
+
239
+ #
240
+ # Get the temporal adjuster
241
+ # @return [CronAdjuster]
242
+ #
243
+ def getTemporalAdjuster # rubocop:disable Naming/MethodName
244
+ org.openhab.core.scheduler.CronAdjuster.new(expression)
245
+ end
246
+
247
+ #
248
+ # Execute the callback
249
+ #
250
+ def run
251
+ callback&.triggered(@trigger, { 'module' => @trigger.id })
252
+ end
253
+
254
+ #
255
+ # Displose of the handler
256
+ # cancel the cron scheduled task
257
+ #
258
+ def dispose
259
+ synchronized do
260
+ super
261
+ return unless @schedule
262
+
263
+ @schedule&.cancel(true)
264
+ end
265
+ logger.trace("cancelled job for trigger '#{@trigger.id}'.")
266
+ end
267
+ end
268
+
269
+ # Implements the ScriptedTriggerHandlerFactory interface to create a new Cron Trigger Handler
270
+ class CronTriggerHandlerFactory
271
+ include org.openhab.core.automation.module.script.rulesupport.shared.factories.ScriptedTriggerHandlerFactory
272
+
273
+ # Invoked by the OpenHAB core to get a trigger handler for the supllied trigger
274
+ # @param [Trigger] OpenHAB trigger
275
+ #
276
+ # @return [WatchTriggerHandler] trigger handler for supplied trigger
277
+ def get(trigger)
278
+ CronTriggerHandler.new(trigger)
279
+ end
280
+ end
281
+ end
167
282
  end
168
283
  end
169
284
  end
170
285
  end
286
+
287
+ # Add the cron handler to OpenHAB
288
+ OpenHAB::DSL::Rules::Triggers::Cron.add_script_cron_handler
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'securerandom'
4
4
  require 'java'
5
+ require_relative 'cron'
5
6
 
6
7
  module OpenHAB
7
8
  module DSL
@@ -111,7 +112,7 @@ module OpenHAB
111
112
  TIME_OF_DAY = 'timer.TimeOfDayTrigger'
112
113
 
113
114
  # @return [String] A cron trigger
114
- CRON = 'timer.GenericCronTrigger'
115
+ CRON = OpenHAB::DSL::Rules::Triggers::Cron::CRON_TRIGGER_MODULE_ID
115
116
 
116
117
  #
117
118
  # Create a trigger
@@ -138,11 +138,9 @@ module OpenHAB
138
138
 
139
139
  # Called by OpenHAB to set the rule engine to invoke when triggered
140
140
  # Must match java method name style
141
- # rubocop:disable Naming/MethodName
142
- def setCallback(callback)
141
+ def setCallback(callback) # rubocop:disable Naming/MethodName
143
142
  @rule_engine_callback = callback
144
143
  end
145
- # rubocop:enable Naming/MethodName
146
144
 
147
145
  #
148
146
  # Dispose of handler which deactivates watcher
@@ -39,7 +39,7 @@ module OpenHAB
39
39
 
40
40
  if timer.respond_to? :id
41
41
  logger.trace("Adding #{timer} with id #{timer.id.inspect} timer ids")
42
- @timer_ids[timer.id] = Set.new unless @timer_ids[timer.id]
42
+ @timer_ids[timer.id] = TimerSet.new unless @timer_ids[timer.id]
43
43
  @timer_ids[timer.id] << timer
44
44
  end
45
45
 
@@ -87,6 +87,19 @@ module OpenHAB
87
87
  @timers.clear
88
88
  end
89
89
  end
90
+
91
+ #
92
+ # Provide additional methods for the timers set
93
+ #
94
+ class TimerSet < Set
95
+ #
96
+ # A shorthand to cancel all the timer objects held within the set
97
+ # so that timers[timer_id].cancel_all is equivalent to timers[timer_id].each(&:cancel)
98
+ #
99
+ def cancel_all
100
+ each(&:cancel)
101
+ end
102
+ end
90
103
  end
91
104
  end
92
105
  end
@@ -7,8 +7,8 @@ require 'java'
7
7
  module OpenHAB
8
8
  module DSL
9
9
  module Types
10
- java_import org.openhab.core.library.types.DateTimeType
11
- java_import java.time.ZonedDateTime
10
+ DateTimeType = org.openhab.core.library.types.DateTimeType
11
+ java_import java.time.ZonedDateTime # This is needed for the addon prior to ruby_class fix (OH 3.2.0)
12
12
 
13
13
  # global alias
14
14
  ::DateTimeType = DateTimeType
@@ -6,7 +6,7 @@ require_relative 'numeric_type'
6
6
  module OpenHAB
7
7
  module DSL
8
8
  module Types
9
- java_import org.openhab.core.library.types.DecimalType
9
+ DecimalType = org.openhab.core.library.types.DecimalType
10
10
 
11
11
  #
12
12
  # Add methods to core OpenHAB DecimalType to make it behave as a Ruby
@@ -6,7 +6,7 @@ require_relative 'percent_type'
6
6
  module OpenHAB
7
7
  module DSL
8
8
  module Types
9
- java_import org.openhab.core.library.types.HSBType
9
+ HSBType = org.openhab.core.library.types.HSBType
10
10
 
11
11
  # global alias
12
12
  ::HSBType = HSBType
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.IncreaseDecreaseType
6
+ IncreaseDecreaseType = org.openhab.core.library.types.IncreaseDecreaseType
7
7
 
8
8
  # Adds methods to core OpenHAB IncreaseDecreaseType to make it more
9
9
  # natural in Ruby
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.NextPreviousType
6
+ NextPreviousType = org.openhab.core.library.types.NextPreviousType
7
7
 
8
8
  # Adds methods to core OpenHAB NextPreviousType to make it more
9
9
  # natural in Ruby
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.OnOffType
6
+ OnOffType = org.openhab.core.library.types.OnOffType
7
7
 
8
8
  # Adds methods to core OpenHAB OnOffType to make it more natural in Ruby
9
9
  class OnOffType
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.OpenClosedType
6
+ OpenClosedType = org.openhab.core.library.types.OpenClosedType
7
7
 
8
8
  # Adds methods to core OpenHAB OpenClosedType to make it more natural in Ruby
9
9
  class OpenClosedType
@@ -5,7 +5,7 @@ require_relative 'decimal_type'
5
5
  module OpenHAB
6
6
  module DSL
7
7
  module Types
8
- java_import org.openhab.core.library.types.PercentType
8
+ PercentType = org.openhab.core.library.types.PercentType
9
9
 
10
10
  # global alias
11
11
  ::PercentType = PercentType
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.PlayPauseType
6
+ PlayPauseType = org.openhab.core.library.types.PlayPauseType
7
7
 
8
8
  # Adds methods to core OpenHAB PlayPauseType to make it more
9
9
  # natural in Ruby
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.PointType
6
+ PointType = org.openhab.core.library.types.PointType
7
7
 
8
8
  # global scope
9
9
  # @!visibility private
@@ -5,7 +5,7 @@ require_relative 'numeric_type'
5
5
  module OpenHAB
6
6
  module DSL
7
7
  module Types
8
- java_import org.openhab.core.library.types.QuantityType
8
+ QuantityType = org.openhab.core.library.types.QuantityType
9
9
 
10
10
  # global alias
11
11
  ::QuantityType = QuantityType
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.types.RefreshType
6
+ RefreshType = org.openhab.core.types.RefreshType
7
7
 
8
8
  # Adds methods to core OpenHAB RefreshType to make it more natural in Ruby
9
9
  class RefreshType # rubocop:disable Lint/EmptyClass
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.RewindFastforwardType
6
+ RewindFastforwardType = org.openhab.core.library.types.RewindFastforwardType
7
7
 
8
8
  # Adds methods to core OpenHAB RewindFastforwardType to make it more
9
9
  # natural in Ruby
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.StopMoveType
6
+ StopMoveType = org.openhab.core.library.types.StopMoveType
7
7
 
8
8
  # Adds methods to core OpenHAB StopMoveType to make it more
9
9
  # natural in Ruby
@@ -7,7 +7,7 @@ require_relative 'comparable_type'
7
7
  module OpenHAB
8
8
  module DSL
9
9
  module Types
10
- java_import org.openhab.core.library.types.StringType
10
+ StringType = org.openhab.core.library.types.StringType
11
11
 
12
12
  #
13
13
  # Add methods to core OpenHAB StringType to make it behave as a Ruby
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.types.UnDefType
6
+ UnDefType = org.openhab.core.types.UnDefType
7
7
 
8
8
  # Adds methods to core OpenHAB UnDefType to make it more natural in Ruby
9
9
  class UnDefType # rubocop:disable Lint/EmptyClass
@@ -3,7 +3,7 @@
3
3
  module OpenHAB
4
4
  module DSL
5
5
  module Types
6
- java_import org.openhab.core.library.types.UpDownType
6
+ UpDownType = org.openhab.core.library.types.UpDownType
7
7
 
8
8
  # Adds methods to core OpenHAB UpDownType to make it more natural in Ruby
9
9
  class UpDownType
@@ -6,7 +6,7 @@ module OpenHAB
6
6
  # This module holds global configuration values
7
7
  module Configuration
8
8
  # -*- coding: utf-8 -*-
9
- LOG_PREFIX = 'jsr223.jruby'
9
+ LOG_PREFIX = 'org.openhab.automation.jruby'
10
10
 
11
11
  #
12
12
  # Gets the log prefix
@@ -82,6 +82,16 @@ module OpenHAB
82
82
  error
83
83
  end
84
84
 
85
+ #
86
+ # Print error and stack trace without calls to internal classes
87
+ #
88
+ # @param [Exception] error A rescued error
89
+ #
90
+ def log_exception(exception, rule_name)
91
+ exception = clean_backtrace(exception)
92
+ error { "#{exception.message} (#{exception.class})\nIn rule: #{rule_name}\n#{exception.backtrace&.join("\n")}" }
93
+ end
94
+
85
95
  private
86
96
 
87
97
  #
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '4.27.0'
8
+ VERSION = '4.28.2'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openhab-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.27.0
4
+ version: 4.28.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-06 00:00:00.000000000 Z
11
+ date: 2022-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,7 +97,6 @@ files:
97
97
  - lib/openhab/dsl/openhab.rb
98
98
  - lib/openhab/dsl/persistence.rb
99
99
  - lib/openhab/dsl/rules/automation_rule.rb
100
- - lib/openhab/dsl/rules/cron_trigger_rule.rb
101
100
  - lib/openhab/dsl/rules/guard.rb
102
101
  - lib/openhab/dsl/rules/item_event.rb
103
102
  - lib/openhab/dsl/rules/property.rb
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'java'
4
- require 'openhab/log/logger'
5
-
6
- module OpenHAB
7
- module DSL
8
- #
9
- # Creates and manages OpenHAB Rules
10
- #
11
- module Rules
12
- #
13
- # Specialized rule for cron triggers with attachments because OpenHAB does not provide trigger UID for cron rules
14
- #
15
- class CronTriggerRule < Java::OrgOpenhabCoreAutomationModuleScriptRulesupportSharedSimple::SimpleRule
16
- include OpenHAB::Log
17
-
18
- def initialize(rule_config:, rule:, trigger:)
19
- super()
20
- set_name("#{rule_config.name}-cron-#{trigger.id}")
21
- set_triggers([trigger])
22
- @rule = rule
23
- @trigger = trigger
24
- logger.trace("Created Cron Trigger Rule for #{@trigger}")
25
- end
26
-
27
- #
28
- # Execute the rule
29
- #
30
- # @param [Map] mod map provided by OpenHAB rules engine
31
- # @param [Map] inputs map provided by OpenHAB rules engine containing event and other information
32
- #
33
- #
34
- def execute(mod = nil, _inputs = nil)
35
- logger.trace "Trigger #{@trigger} fired for base rule #{@rule.inspect}"
36
- inputs = { 'module' => @trigger.id }
37
- @rule.execute(mod, inputs)
38
- end
39
- end
40
- end
41
- end
42
- end