Hey Henry,
Might want to flag this is an OCS SCXML question, as a lot of people will probably assume your talking about ORS SCXML and be a little confused.
Anyway, the reason this is not addressable is because the callresult only returns a single property. That is the call result :)
If you want to know the value of fields at any point, you need to capture them at the point of the
ocs.next_record event and then assign them to your data model. Something like the below:
<datamodel>
<data ID="chain_id" expr="'0'"/>
<data ID="custom_field_v" expr="'default'"/>
</datamodel>
....
<state id="NextRecord">
<onentry>
<ocs:next_record/>
</onentry>
<transition event="ocs.next_record" cond= "_event.data.record_id == '0'" target="end"/>
<transition event="ocs.next_record" cond= "_event.data.record_id != '0'" target="MakeCall">
<assign location="_data.record_id" expr = "_event.data.record_id" />
<assign location="_data.custom_field_v" expr = "_event.data.custom_field" />
</transition>
</state>
Regards,
------------------------------
Jason Mclennan
Commonwealth Bank of Australia
------------------------------
Original Message:
Sent: 08-29-2018 17:58
From: Henry Sun
Subject: Retrieve custom fields in SCXML
I am trying to retrieve custom fields from "callresult" event in SCXML with _event.data.fields prefix but it seems the prefix is not defined in this event. Can someone please help point a direction of how to retrieve any mandatory and custom fields in "callresult" event?
Thanks!
------------------------------
Henry
------------------------------