Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..
1077 views

Invoke Method 2 question - complex array arguments with variable number of values

Jump to solution

I've dealt a bit of WSDL coding in HPOO but I've hit something I'm looking to see how anyone dealt with.  The topic is complex XML array arguments.

 

Say you have a portion of your xmlTemplate that looks like this:

 

<ns:AffectedCI type="Array">
<!--Zero or more repetitions:-->
<ns:AffectedCI type="String" mandatory="" readonly="">?</ns:AffectedCI>
</ns:AffectedCI>

 

So basically a simple array structure of multiple value.

 

The WSDL import wizard provides the as the inputMap for this array:

 

CreateChangeTaskOORequest|model|instance|middle|AffectedCI|*|AffectedCI=AffectedCI*

 

In a typical working config for the above, you would basically do the following if you have three values for the AffectedCI array (at least this is what I know works):

 

1) Change the inputMap to look like this:

 

CreateChangeTaskOORequest|model|instance|middle|AffectedCI|0|AffectedCI=AffectedCI0

CreateChangeTaskOORequest|model|instance|middle|AffectedCI|1|AffectedCI=AffectedCI1

CreateChangeTaskOORequest|model|instance|middle|AffectedCI|2|AffectedCI=AffectedCI2

 

2) Make sure you the flow variables AffectedCI0, AffectedCI1, and AffectedCI2 defined with the three different values.

 

3) Make sure the "Invoke Method 2" step has three input fields called AffectedCI0 (which uses ${AffectedCI0} as the value), AffectedCI1 (${AffectedCI1} as value) and AffectedCI2 (${AffectedCI2} as value).

 

The above will correctly craft the necessary outbound XML request document with the array correctly structured.

 

The question is what ... how do you deal with the situation where the number of values for the AffectedCI array is variable ... 1, 2, 30 100, whatever.    I have logic to update the inputMap as shown in #1 above.

 

The issue is you can't create input fields on a step dynamically while a flow is running.  

 

On way is to create a "Invoke Method 2" step with some specific number of input fields ... say AffectedCI0 through AffectedCI50.  I have scriptlet logic that will dynamically generate the necessary flow variables as needed from a comma separated list.

 

I don't like this as it means the subflow is limited to 1-50 values  .... what happens if there are 51 ?

 

Curious if anyone has dealt with this and how.

Labels (1)
0 Likes
1 Solution

Accepted Solutions
Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..

Re: Invoke Method 2 question - complex array arguments with variable number of values

Jump to solution

Hmmm apparently this is being addressed in a content patch.  

0 Likes
5 Replies
Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..

Re: Invoke Method 2 question - complex array arguments with variable number of values

Jump to solution

Pretty this can be done using the HTTP Client Post Raw step.  Anyone take this approach ?

0 Likes
Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..

Re: Invoke Method 2 question - complex array arguments with variable number of values

Jump to solution

Hmmm apparently this is being addressed in a content patch.  

0 Likes
Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..

Re: Invoke Method 2 question - complex array arguments with variable number of values

Jump to solution

Read the HPOO 9.00 Content Patch 7 Web Services Guide on HPLN .. HP finally addressed this 🙂

0 Likes
Absent Member.. ntt00015 Absent Member..
Absent Member..

Re: Invoke Method 2 question - complex array arguments with variable number of values

Jump to solution

Hi,

 

If you have not applied the content pack 7 yet, you have to create your own XML and use HTTP POST. I have not applied the patch so I am using this workaround.

 

But with content pack 7 we can be able to use JSON format ,so it is possible to send multiple repetition tags.

0 Likes
Honored Contributor.. RiverRat_1 Honored Contributor..
Honored Contributor..

Re: Invoke Method 2 question - complex array arguments with variable number of values

Jump to solution

I figured ... I used the HTTP Post for a customer for sample JIRA flow a while back.  Just curious if anyone used that approach.

 

CP7 fix for multivalue arrays works rather nicely.  The WS Wizard Guide needs to be updated some with an example in this area using a JSON array structure but it does work.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.