Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Web Service not sending variable properly

Avatar

Level 3
Hi,

I have a Web Service that I'm going to use to gather information from a database. When the data is sent over from http://server:8080/services/ it does not seem to come over properly. The data is in different variables than it is supposed to be.



I pass in 5 variables, 4 are required, 1 is optional and I return information in the optional one. The first thing I do is run this script to format the data and at that first System.out the information is already wrong.



Any Ideas?



Thanks,

Rob V.



import com.adobe.pof.omapi.POFObjectManager;

import com.adobe.workflow.manager.ProcessManager;

POFObjectManager _om = patServiceContext.getObjectManager();

ProcessManager _pm = patServiceContext.getProcessManager();



System.out.println("Profile Code: '" + patExecContext.getProcessDataStringValue("/process_data/@profilecode") + "'");



if(patExecContext.getProcessDataStringValue("/process_data/@profilecode")==null)

patExecContext.setProcessDataStringValue("/process_data/@profilecode","%");



if(patExecContext.getProcessDataStringValue("/process_data/@profilecode").equals(""))

patExecContext.setProcessDataStringValue("/process_data/@profilecode","%");



System.out.println("Profile Code: " + patExecContext.getProcessDataStringValue("/process_data/@profilecode"));



if(patExecContext.getProcessDataStringValue("/process_data/@phantomstate")=="-1")

patExecContext.setProcessDataStringValue("/process_data/@phantomstate"," = 50");

else

patExecContext.setProcessDataStringValue("/process_data/@phantomstate"," is null");



System.out.println("Phantom State: " + patExecContext.getProcessDataStringValue("/process_data/@phantomstate"));
10 Replies

Avatar

Level 9
Hi

Try using VariableLogger at:

http://www.avoka.com/Avoka/qpac_library.shtml

to verify whether the data is coming in wrong, or whether there is something wrong in your script.



In your script, you may find that a setProcessData call does not "commit" the data till after the step has completed.



Howard

http://www.avoka.com

Avatar

Level 3
Hi Howard,

Thanks for your reply. I downloaded the variable logger as you requested, and they are infact coming in wrong. Have you heard of this before?



Thanks,

Rob V.

Avatar

Level 9
Hi Robert

No, I've not seen that before.

Sorry, can't help. I'd send the workflow to Adobe support.

Good luck.

Howard

Avatar

Level 3
Example of a Synchronous Invoke:





F
0
ASSY
ANC
304





The profile code is supposed to be filed in by this command. Everything there is listed in the right spot.





304
ANC
is null
0
F






Notice that the Material Group is now in the Profile Code. Phantom State should be set to "is null" but it did not get set because of the proper variable. Procurement type has the variable it was supposed to check.

I think you get the point here.

Any ideas? Suggestions?

Avatar

Level 9
Hi

Try removing all your QPACs except the Variable logger. (Or at least unlink all the steps except the Variable logger, and then make variable logger the start action.)



Or even try to create a brand new process, and start again. It's possible something is just screwed up, and starting again will fix it.



Howard

Avatar

Level 3
Hi Howard,

Well, it's definetly is screwed up, but I still don't know why. I took your advice and removed the links in the original one and set the variable logger to the start action. They were still coming in wrong. Then I created a new one, even in a new process type, still no luck.



Here's what the variable logger outputs




2007-03-20 11:56:01,698 INFO [STDOUT] Variable Properties:

VP1174405124639:length = [100]

2007-03-20 11:56:01,698 INFO [STDOUT] [PID:405] /process_data/@status: 1

2007-03-20 11:56:01,698 INFO [STDOUT] Variable Properties:

VP1174405124640:length = [100]

2007-03-20 11:56:01,699 INFO [STDOUT] [PID:405] /process_data/@profilecode: ANC

2007-03-20 11:56:01,699 INFO [STDOUT] Variable Properties:

VP1174403346303:length = [100]

2007-03-20 11:56:01,699 INFO [STDOUT] [PID:405] /process_data/@materialtype:

2007-03-20 11:56:01,699 INFO [STDOUT] Variable Properties:

VP1174403346304:length = [100]

2007-03-20 11:56:01,700 INFO [STDOUT] [PID:405] /process_data/@materialgroup: F

2007-03-20 11:56:01,700 INFO [STDOUT] Variable Properties:

VP1174403346305:length = [100]

2007-03-20 11:56:01,700 INFO [STDOUT] [PID:405] /process_data/@procurementtype: 0

2007-03-20 11:56:01,700 INFO [STDOUT] Variable Properties:

VP1174403346306:length = [100]

2007-03-20 11:56:01,701 INFO [STDOUT] [PID:405] /process_data/@phantomstate: ASSY

2007-03-20 11:56:01,701 INFO [STDOUT] Variable Properties:

VP1174403346307:length = [100]






Any clue, or should I just contact Adobe support?

Avatar

Level 9
Hi Robert

This is very weird, haven't seen anything like this.

I'd contact support.

Good luck!

Howard

Avatar

Former Community Member
Hello Robert,



I am seeing pretty much the same problem. Are you making a synchronous or asynchronous call? Synchronous calls seem to be less prone to the variable mix-ups than asynchronous calls, although synchronous calls do exhibit the same problem every now and then.



I haven't seen a solution to this problem yet. Have you?



Dennis

Avatar

Former Community Member
Hi Guys,



anyone found the solution to this? i'm seeing this everytime i execute the workflow via /services or through a form.



i'm using Sandbox version 7.2.2



cheers,

parth

Avatar

Former Community Member
What I have done is packaging up all the variables in XML, so that the only input variable is the XML file, and then mapped the elements as inputs.