‘Add Contact’ is an action within >‘Number’?‘No’. It requires some input to execute the action. Why do I get the error above when trying to call it?
Model ‘model’
/home/coder/project/models/model/application.alan:12038:33 to 12038:35 error: no valid ‘assigned variable’ found for ‘head’. Unexpected ‘variable’:
-
expected: ‘assigned’ at /home/coder/project/models/model/application.alan:12038:33 to 12038:35
-
but found: ‘unassigned’ at :1:1 to 1:1
/home/coder/project/models/model/application.alan notice: 1 semantic errors, with 100 unknown
failed to compile: compiler failed
'CRM': stategroup = switch >'Number'.'CRM' (
|'Yes' => 'Yes' ( )
|'No' as $'no' => 'No' ( )
) (
'Yes' { }
'No' {
'Add Contact': action {
'Relation Exists': stategroup @default: 'Yes' (
'No' {
'Type': stategroup @default: 'Company' (
'Person' { }
'Company' {
'Official Company Name': text
}
)
'Default Language': text -> ^ ^ ^ ^ ^ .'Relationship Management'.'Languages'[]
}
'Yes' {
'Relation': text -> ^ ^ ^ ^ ^ .'Relationship Management'.'Relations'[]
'Contact Exists': stategroup @default: 'Yes' (
'Yes' {
'Contact': text -> ^ >'Relation'.'Contacts'[]
}
'No' { }
)
}
)
} as $'contact' => execute $^ $'no'.'Add Contact' (
'Relation Exists' = switch $'contact'.'Relation Exists' (
|'No' as $ => create 'No' (
'Type' = switch $ .'Type' (
|'Person' => create 'Person' ( )
|'Company' as $ => create 'Company' (
'Occifical Company Name' = $ .'Official Company Name'
)
)
'Default Language' = $ .'Default Language'
)
|'Yes' as $ => create 'Yes' (
'Relation' = $ .'Relation'
'Contact Exists' = switch $ .'Contact Exists' (
|'Yes' as $ => create 'Yes' (
'Contact' = $ .'Contact'
)
|'No' => create 'No' ( )
)
)
)
)