cpee-worklist 1.0.20 → 1.0.21

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: 5f6fef7844b1068dc25aedad2ad96649e3821e68e8056a385ed7ff752f53071c
4
- data.tar.gz: ec643d4a0e368d4e584aebf23352b38c23b71481965c07064cbc7bd0db67ca42
3
+ metadata.gz: 829230e05700e3690314636b97718b8ce3f93d75e544efc5977dc5ec6e6a71c2
4
+ data.tar.gz: 1ef8e72be3ed60a2cf3b7ce9f2be8a41357bdf0509219552ca5fced72f51ba87
5
5
  SHA512:
6
- metadata.gz: 9fda76f7240d70935a5f8e7066d083dfbf4658e89b68772c268e86cc1ce5b6dd2b0f0ca620d8905a746be30e922fdccf331adbeb16eb7637720245dd4671d38e
7
- data.tar.gz: 33ad966f1cc9302ed2f84dac3d5ffa485b971b56c4f7a53974c04500271e25faa19b0c977c21a207977861c46d3fd6f34de534ac1e0b6ddbdf9a42539cdefc48
6
+ metadata.gz: 6bb1e150e8174ce17592093bda91b86d531711458aee10f31fc4b9ed2c2acb49461e82547064fd44389bc4897251e227893d7eb313074cd2081046c1b3ea8e3a
7
+ data.tar.gz: 7a4fd5d1dfc77f786e00eee33da828ed7a827f6bd19d4bb77b77968c20f4bfacd80391f0aee98620cc2ad0cc319bfd688f05e45b0684e4ee1036f14b7ea2d5b2
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-worklist"
3
- s.version = "1.0.20"
3
+ s.version = "1.0.21"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
6
6
  s.summary = "Worklist for the cloud process execution engine (cpee.org)"
@@ -63,17 +63,32 @@ module CPEE
63
63
  controller = @a[0]
64
64
 
65
65
  activity = {}
66
- activity['process'] = @h.keys.include?('CPEE_ATTR_INFO') ? "#{@h['CPEE_ATTR_INFO']} (#{@h['CPEE_INSTANCE'].split('/').last})" : "DUMMY PROCESS (#{@h['CPEE_INSTANCE'].split('/').last})"
67
- activity['label'] = @h.keys.include?('CPEE_INSTANCE') ? "#{@h['CPEE_LABEL']}" : 'DUMMY LABEL'
68
- activity['user'] = []
69
- activity['url'] = @h['CPEE_CALLBACK']
70
- activity['id'] = @h['CPEE_CALLBACK_ID']
66
+ if @h.keys.include?('CPEE_INSTANCE')
67
+ activity['process'] = @h.keys.include?('CPEE_ATTR_INFO') ? "#{@h['CPEE_ATTR_INFO']} (#{@h['CPEE_INSTANCE'].split('/').last})" : "DUMMY PROCESS (#{@h['CPEE_INSTANCE'].split('/').last})"
68
+ activity['label'] = @h.keys.include?('CPEE_INSTANCE') ? "#{@h['CPEE_LABEL']}" : 'DUMMY LABEL'
69
+ activity['user'] = []
70
+ activity['url'] = @h['CPEE_CALLBACK']
71
+ activity['id'] = @h['CPEE_CALLBACK_ID']
72
+
73
+ activity['cpee_activity_id'] = @h['CPEE_ACTIVITY']
74
+ activity['cpee_base'] = @h['CPEE_BASE']
75
+ activity['cpee_instance'] = @h['CPEE_INSTANCE']
76
+
77
+ activity['uuid'] = @h['CPEE_ATTR_UUID']
78
+ else
79
+ activity['process'] = @h.keys.include?('P_NAME') ? "#{@h['P_NAME']} (#{@h['P_INSTANCE']})" : "DUMMY PROCESS (#{@h['P_INSTANCE']})"
80
+ activity['label'] = @h.keys.include?('A_LABEL') ? "#{@h['A_LABEL']}" : 'DUMMY LABEL'
81
+ activity['user'] = []
82
+ activity['id'] = @h['A_CALLBACK']
83
+ activity['id'] = SecureRandom.uuid if @h['A_CALLBACK'].nil? || @h['A_CALLBACK'].strip == ''
84
+ activity['url'] = "https://cpee.org/callbacks/#{activity['id']}/"
71
85
 
72
- activity['cpee_activity_id'] = @h['CPEE_ACTIVITY']
73
- activity['cpee_base'] = @h['CPEE_BASE']
74
- activity['cpee_instance'] = @h['CPEE_INSTANCE']
86
+ activity['cpee_activity_id'] = ''
87
+ activity['cpee_base'] = ''
88
+ activity['cpee_instance'] = ''
75
89
 
76
- activity['uuid'] = @h['CPEE_ATTR_UUID']
90
+ activity['uuid'] = @h['P_INSTANCE'] || SecureRandom.uuid
91
+ end
77
92
 
78
93
  omo = @p.shift.value
79
94
  activity['orgmodel'] = @h[ 'CPEE_ATTR_' + omo.upcase] || omo
@@ -92,7 +107,7 @@ module CPEE
92
107
  activity['deadline'] = @p.first.name == 'deadline' ? ((Time.now + ChronicDuration.parse(@p.shift.value)) rescue nil): nil
93
108
  activity['restrictions'] = []
94
109
  rests = JSON::parse(@p.shift.value) rescue nil
95
- activity['restrictions'] += rests unless rests.nil?
110
+ activity['restrictions'] += rests unless rests.nil? || rests.empty?
96
111
  if @p.first.name == 'prioritization'
97
112
  val = @p.shift.value
98
113
  activity['prioritization'] = (JSON::parse(val) rescue val.gsub(/[\[\]()<>"']/,'').split(/\s*[,;]\s*/))
@@ -36,7 +36,9 @@
36
36
  <data type="string"/>
37
37
  </element>
38
38
  </zeroOrMore>
39
- <ref name="permissions"/>
39
+ <optional>
40
+ <ref name="permissions"/>
41
+ </optional>
40
42
  </define>
41
43
 
42
44
  <define name="subjects">
@@ -116,7 +116,7 @@
116
116
  </attribute>
117
117
  <data type="string"/>
118
118
  </element>
119
- </oneOrMore>
119
+ </zeroOrMore>
120
120
  </element>
121
121
  </zeroOrMore>
122
122
  </element>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-worklist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.20
4
+ version: 1.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler