mio-config 2.16.0 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mio/model/wait_groovy_script.rb +66 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e67e44f47792ce4b3d6f16e5f89e154300961e9
|
4
|
+
data.tar.gz: 681ce55323cd2ac96e92242c938fdd4f53ee9107
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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"
|