mio-config 2.16.0 → 2.17.0

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
  SHA1:
3
- metadata.gz: 4756bd98af5239e9a478e08923f91cf55828ba6b
4
- data.tar.gz: 5dcbab1047fd189524273ce1abb2503b88f5ad25
3
+ metadata.gz: 9e67e44f47792ce4b3d6f16e5f89e154300961e9
4
+ data.tar.gz: 681ce55323cd2ac96e92242c938fdd4f53ee9107
5
5
  SHA512:
6
- metadata.gz: b9970cbe570cb13c483273fb73643f423ee63b910e848fac3ddff2e22daacdd7419fb55bd99b4a4fd539f0832a305d07c2cc17d85e6137c79a7cb004a512c894
7
- data.tar.gz: 86e98acb6a8f6b6f99bc75edd0ccaa0cfe945cae372c86b69697b8b7f6873f2b2a19d1d3047a9777bcea8774466f5b7d0ca4db14bf56b167663f1f853508ba81
6
+ metadata.gz: 1ad5b5e2ab0daeeba411e3d4ea02aafe28252821315958e8dc07e6b88c0ece2ce594d662651a1989dbbc1a4190a4720d5274e1abb89682259fc84db82b209a5d
7
+ data.tar.gz: 1ba4fa735ef999155710fb509ce6b72777484acacdbba3d52f48ab74fc9366d06521fed1c70203bb949c15bcf8375a310f0150096ec3bdad0b560764cc4c81fa
@@ -0,0 +1,66 @@
1
+ class Mio
2
+ class Model
3
+ class WaitGroovyScript < Model
4
+ MIN_TIMEOUT_PERIOD = 10000
5
+ MIN_POLLING_PERIOD = 10000
6
+
7
+ set_resource :actions
8
+
9
+ field :name, String, 'Script name'
10
+ field :displayName, String, 'Script Display name'
11
+ field :visibility, Array, 'Ids of the accounts which may see the import action', [4]
12
+ field :script, String, 'The groovy script (inline) ', '"File.read(/path/to/script.groovy)"'
13
+ field :jars, Array, 'JARs to load on remote, empty for none', []
14
+ field :imports, Array, 'Imports to reference within groovy script, empty for none', []
15
+ field :timeout, Fixnum, 'Wait time out', 1000 * 60 * 60
16
+ field :pollingTimePeriodMs, Fixnum, 'Time between script runs (polling time)', 1000 * 60
17
+
18
+ field :enable, Symbol, ':true or :false', :true
19
+ field :start, Symbol, ':true or :false', :true
20
+
21
+ def create_hash
22
+ plugin = 'tv.nativ.mio.plugins.actions.wait.ScriptedWaitCommand'
23
+ {name: @args.name,
24
+ pluginClass: plugin,
25
+ type: 'script',
26
+ visibilityIds: @args.visibility,
27
+ runRuleExpression: ''
28
+ }
29
+ end
30
+
31
+ def config_hash
32
+ {'script_type': {
33
+ script: @args.script
34
+ },
35
+ imports: {
36
+ 'jar-url': @args.jars.map{|jar| {value: jar, isExpression: false}},
37
+ import: @args.imports.map{|import| {value: import, isExpression: false}}
38
+ },
39
+ 'timeout': @args.timeout,
40
+ 'polling-time-period': @args.pollingTimePeriodMs
41
+ }
42
+ end
43
+
44
+ def validate_timeout
45
+ unless @args.timeout >= MIN_TIMEOUT_PERIOD
46
+ raise Mio::Model::ObjectVariableInvalid, "Timeout period [#{@args.pollingTimePeriodMs}] must be greater or equal to [#{MIN_TIMEOUT_PERIOD}]"
47
+ end
48
+ end
49
+
50
+ def validate_polling_time_period
51
+ unless @args.pollingTimePeriodMs >= MIN_POLLING_PERIOD
52
+ raise Mio::Model::ObjectVariableInvalid, "Polling period [#{@args.pollingTimePeriodMs}] must be greater or equal to [#{MIN_POLLING_PERIOD}]"
53
+ end
54
+ end
55
+
56
+ def validate
57
+ super
58
+ validate_timeout
59
+ validate_polling_time_period
60
+
61
+ true
62
+ end
63
+ alias_method :valid?, :validate
64
+ end
65
+ end
66
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mio-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.0
4
+ version: 2.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jspc
@@ -129,6 +129,7 @@ files:
129
129
  - "./lib/mio/model/place_holder_group_asset_action.rb"
130
130
  - "./lib/mio/model/s3.rb"
131
131
  - "./lib/mio/model/variant.rb"
132
+ - "./lib/mio/model/wait_groovy_script.rb"
132
133
  - "./lib/mio/model/workflow.rb"
133
134
  - "./lib/mio/model/workflow/node.rb"
134
135
  - "./lib/mio/model/workflow/transition.rb"