Eric1
Novice

How to use the value of a deserialized typed array in an advanced smartobject

Hi,

I try to create a smartobject that calls different HR Directorie webservices ( return format is JSON ) to retreive the manager of a user.

I have no problem to perform the REST call, however i can't find out how to use the result of a previous service object in the following when the result is created from a deserialisation.
Let me explain myself.
To get the Manager I need 4 services object method call in my smartobject:

1 - Call the HR webservice with the usere ID to retreveive all the user info ( which contains the manager id ) as a userobject list

2 - The result is always an object list ( even when calling with an id ) so i need to deserialize the typed array ( no issue there )

3 - I wan't to retreive the manager info so I call step 1 again with the manager id which is a smartobject propertie now

4 - I deserialize the typed array

 

My issue is during step 3, even if i can map the method parameter to the managerid ( as a smartobject propertie ), it is always empty ( it is not if i stop after step 2 ). I tried to create a smartobject method parameter, assign it during step 2 to use is during step 3. But no luck so far, same issue, the parameter sent to the webservice is empty.

 

So if anyone got a clue of how to do this i'll greatly appreciate it.

 

By the way i can't change the HR webservice as it is a closed source piece of software. The purpose of this smartobjcet  is to be called from a workflow, so creating a view to create a custom rule won't solve my issue.

 

Thanks in advance

 

0 Kudos
2 Replies
NigelStratton
Apprentice

Re: How to use the value of a deserialized typed array in an advanced smartobject

My guess this is a timing issue, you're calling step 1 from step 3 before step 2 has finished.

Are you placing the value of step 2 into a variable? Can you check the value of that variable before step 3?

0 Kudos
Eric1
Novice

Re: How to use the value of a deserialized typed array in an advanced smartobject

Hi thanks for your reply.
All the work is done in the same advanced smartojbect method ( step 1 to 4 are four Method Bindings ).
I check the content of step 2 by removing step 3 and 4 and there is a value. However i can't check if there is some data when leaving step 3 and 4 ( as it's in a smartobject).

 

I assumed there couldn't be any timing issues withing  method bindings in a smartobject. Am i wrong?

 

0 Kudos