Has anyone been able to do this?
I have an assign that maps from XML based variables to a JSON Object, without issue. I then want to add the JSON Object to a JSON Array. I've created my JSON Array variable, as per normal.
When I map the JSON Object onto the JSON Array it still appears to be an object.
<variable name="JIRA_Link" bpelx:json="object"/>
<variable name="JIRA_Array" bpelx:json="array"/>
<assign name="mapToTSRUnlink">
<copy>
<from expressionLanguage="javascript">process.SRid</from>
<to expressionLanguage="javascript">process.JIRA_CSR_Unlink["SR ID"]</to>
</copy>
<copy>
<from>$Request_ID</from>
<to expressionLanguage="javascript">process.JIRA_CSR_Unlink["Request ID"]</to>
</copy>
<copy>
<from expressionLanguage="javascript">process.JIRA_Link</from>
<to expressionLanguage="javascript">process.JIRA_Array</to>
</copy>
</assign>
After mapping both the JSON Object and JSON Array variables look like :
| { "SR ID": "10353734", | "Request ID": "668804" } |
My JSON Array needs to look like (this is a restriction placed on me a third party, its not something I can change):
| [{ "SR ID": "10353734", | "Request ID": "668804" }] |
Any suggestions?