28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_responsibleParty.rb', line 28
def self.unpack(hRParty, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hRParty.empty?
@MessagePath.issueWarning(710, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intResParty = intMetadataClass.newResponsibility
outContext = 'responsible party'
outContext = inContext + ' > ' + outContext unless inContext.nil?
if hRParty.has_key?('role')
intResParty[:roleName] = hRParty['role']
end
if intResParty[:roleName].nil? || intResParty[:roleName] == ''
@MessagePath.issueError(711, responseObj, inContext)
end
if hRParty.has_key?('roleExtent')
aExtent = hRParty['roleExtent']
aExtent.each do |hItem|
unless hItem.empty?
hTimeExtent = Extent.unpack(hItem, responseObj, outContext)
unless hTimeExtent.nil?
intResParty[:roleExtents] << hTimeExtent
end
end
end
end
if hRParty.has_key?('party')
hRParty['party'].each do |hParty|
unless hParty.empty?
party = Party.unpack(hParty, responseObj, outContext)
unless party.nil?
intResParty[:parties] << party
end
end
end
end
if intResParty[:parties].empty?
@MessagePath.issueError(712, responseObj, inContext)
end
return intResParty
end
|