standard_procedure_operations 0.7.1 → 0.7.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: 4d3727c9772fdc1cd01eb3438c01f0fdea6ea03b02e9ab631363bc20fac73ffc
4
- data.tar.gz: 8d75786ef589b7029d49d743a25c7e38723124d9cf095e59cae072969a61ad0e
3
+ metadata.gz: 462512e945573c5809f480e318e03c17a15604e8f8362934d2c730f2827f54a5
4
+ data.tar.gz: 3446e47c75e17db5384b8ba8a86a5740fbd095ea6a3f57ae6eb9d05dbac50e1c
5
5
  SHA512:
6
- metadata.gz: 58662325c764ab6fcbca8f047d4077a773e980bfcfda739d0a1076e8b9f5b579744de1938d2119897b33091a5de579e5d6747bd090f80a4f27a2237b287f4253
7
- data.tar.gz: 1aff44b8fd34fe03bc92e1da8ab56db4f80b29cc5fc3a1e659022c2be61b8caf9ed92e23ce2572be58421f1a6ad03e96360a2f504424b1b00860a9ddd67b5d51
6
+ metadata.gz: 442ba282285358dc7baa1bbd9f00a4fa2aaa76ee4009a0638073f95e6e099c993d7eb0b9381884b781432874bd542a2a8fde4a6c150bd7c3fdf5028f94ac6951
7
+ data.tar.gz: 6458262e8f3efd03256c1a4e6efe7be32d925ce88852afc93869d28b6ed7e77e6fb0108020ea1c39ab15ca79feaaa5eb2d45e129ce0829064c1b779d727e39eb
data/README.md CHANGED
@@ -9,7 +9,7 @@ In effect, that flowchart is a state machine - with "decision states" and "actio
9
9
 
10
10
  ## Breaking Change
11
11
 
12
- Version 0.7.0 includes breaking changes. There are migrations which rename your existing `operations_tasks` and `operations_task_participants` tables (so the data is not deleted), then a new `operations_tasks` table is created with a simplified structure.
12
+ Version 0.7.0 includes breaking changes. When you run `bin/rails operations:migrations:install` one of the migrations will drop your existing `operations_tasks` and `operations_task_participants` tables. If you need the historic data in those tables, then edit the migration to rename the tables instead. Also you will need to update your tests to use the new `test` method.
13
13
 
14
14
  ## Usage
15
15
 
@@ -193,7 +193,7 @@ end
193
193
  ```
194
194
  #### Wait handlers
195
195
 
196
- The registration process performs an action, `send_invitation` and then waits until a `name_provided?`. A `wait handler` is similar to a `decision handler` but if the conditions are not met, instead of raising an error, the task goes to sleep. A background process (see bwlow) wakes the task periodically to reevaluate the condition. Or, an `interaction` can be triggered; this is similar to an action because it does something, but it also immediately reevaluates the current wait handler. So in this case, when the `register!` interaction completes, the `name_provided?` wait handler is reevaluated and, because the `name` has now been supplied, it can move on to the `create_user` state.
196
+ The registration process performs an action, `send_invitation` and then waits until a `name_provided?`. A `wait handler` is similar to a `decision handler` but if the conditions are not met, instead of raising an error, the task goes to sleep. A background process (see below) wakes the task periodically to reevaluate the condition. Or, an `interaction` can be triggered; this is similar to an action because it does something, but it also immediately reevaluates the current wait handler. So in this case, when the `register!` interaction completes, the `name_provided?` wait handler is reevaluated and, because the `name` has now been supplied, it can move on to the `create_user` state.
197
197
 
198
198
  When a task reaches a wait handler, it goes to sleep and expects to be woken up at some point in the future. You can specify how often it is woken up by adding a `delay 10.minutes` declaration to your class. The default is `1.minute`. Likewise, if a task does not change state after a certain period it fails with an `Operations::Timeout` exception. You can set this timeout by declaring `timeout 48.hours` (the default is `24.hours`).
199
199
 
@@ -350,4 +350,4 @@ The gem is available as open source under the terms of the [LGPL License](/LICEN
350
350
  - [x] Add visualization export for task flows
351
351
  - [ ] Replace ActiveJob with a background process
352
352
  - [ ] Rename StateManagent with Plan
353
- - [ ] Add interactions
353
+ - [ ] Add interactions
@@ -26,7 +26,9 @@ module Operations
26
26
  has_attribute :exception_backtrace, :string
27
27
 
28
28
  def call(immediate: false)
29
- while active?
29
+ state = ""
30
+ while active? && (state != current_state)
31
+ state = current_state
30
32
  Rails.logger.debug { "--- #{self}: #{current_state}" }
31
33
  (handler_for(current_state).immediate? || immediate) ? call_handler : go_to_sleep!
32
34
  end
@@ -1,3 +1,3 @@
1
1
  module Operations
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_procedure_operations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahoul Baruah
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-04 00:00:00.000000000 Z
10
+ date: 2025-07-10 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails