Sometimes customers wish to transfer information from the context of the client session into the Form Guide. In particular, if the Guide is hosted inside LiveCycle Workspace ES, selected information that is in the HTPP Headers is desired to be made available to the Guide. This can be done.
Workspace ES provides all, yes all, not just a subset, of the HTTP headers to both the render service and the submit service. They are available to those services for any use that they see fit. Unfortunately there is an unexposed link in LiveCycle ES that makes this harder to accomplish. FYI: that link is properly exposed in LiveCycle ES Update 1. Nevertheless the feat can still be accomplished in LiveCycle ES.
Let’s say that you have an HTTP Header of special interest called ‘yourChoice’. We’ll go through the steps needed to have your render service ‘see’ that header.
First, in the render service, create a new process variable. I’ve called it ‘allHttpHeaders’. Mark it as type ‘map’, and mark it as an ‘input’ variable.
Save your updated render service. In your main process, open up the User Service step that references that render service. Examine the process’ Variable list. Naturally it will have a variable that is the ‘Document Form’ that is to be rendered. If you double click on that you will see something like the following:
Now click on Advanced Settings … in order to see:
Because ‘allHttpHeaders’ was defined as an ‘Input’ variable it shows up in these options — begging you to map something to it.
ASIDE: BTW, since I’ve shown the above screen, notice the ability to put the User’s Common Name into a process variable that you have defined as an Input variable in your render service. I happened to name that process variable, a simple string, as ‘UserName’. Above you can see that there is a built-in source for that information under the ‘task’ group of items. This is a great way to get the actual Workspace ES user’s name into your form. This is often an issue since one can’t know which user will process the form until he/she actually chooses to do so (e.g. has taken the task from a group/shared queue). Using the above, your form can show exactly which user is processing the form.
Ok, back to extracting info from any HTTP Header. Your source for a map of all the HTTP Headers comes from the Custom Configuration area of data items. So change the default ‘xpath’ entry in the dropdown to Custom Configuration. If you click the "…" button on the right hand side you will see: <unfortunately>
Alas, there is no entry in there (in LiveCycle ES) that is what you want. ‘environmentBuffer’ gives you some of the HTTP Headers but not all of them. In LiveCycle ES Update 1 there is another entry in the dropdown named ‘httpHeaders’. That would be the one you want. In LiveCycle ES you are still able to simply key that in. You would end up with:
Great! Now your process is providing your render service with all of the HTPP Headers. Save your process, and re-open the render service. Ok, I could’ve done this all at once but I wanted to walk through the steps.
What I want to show now is how you extract information from the ‘allHttpHeaders’ map. You could stuff such data into the data file and have it rendered. You might use it in some other way in some other custom step of the render service. For now, I’ll just show extracting information out of the map and placing it in a simple string variable — which you can later use for any purpose you like. First we need that string variable as a place to store the HTTP header of choice. Let’s create a string variable with the name ‘myHeaderOfInterest’.
Not a lot to that. Note that it is a string, and it is neither ‘Input’ or ‘Output’. We don’t want it showing up anywhere begging to be mapped. It is simply an internal process variable for use inside this render service.
Now for the extraction. As usual we will use the standard SetValue operation to access the data elements in question. Drag on a SetValue operation; under the Properties tab add (+) a new assignment. The left hand side — the target location for the value assignment — is easy. Just use the [...] mapping button and double click on ‘myHeaderOfInterest’. The right hand side — the expression value to be set — is a bit more interesting. To start, use the [...] mapping button and double click on the ‘allHttpHeaders’ entry.
After the double click you will have only the /process_data/allHttpHeaders part. You have to key in the [@id='yourChoice'] part yourself. There is no way, at render service design time, that LiveCycle can know what ids will be in the map at runtime and hence you have to specify that on your own. Of course, ‘yourChoice’ is a pretty unlikely name of an HTTP Header of interest but I’m sure you can supply, well, your choice
You will end up with a SetValue assignment as follows. Your chosen HTTP Header is in a string that you can work with as desired.
Add the HTTP Header context to your oyster.