Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Mapping JSON Object to JSON Array in BPEL assign

2821136Feb 23 2017 — edited Feb 24 2017

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?

This post has been answered by 2821136 on Feb 24 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2017
Added on Feb 23 2017
2 comments
1,395 views