Posts tagged 'Workbench'

LiveCycle ES2 Workbench add-ons

Hi All,

I’m really looking forward to using the Workbench add-ons that adobe just released on the labs.

More info and download at – http://labs.adobe.com/technologies/lcworkbench_addons/
Here are my fav features among others -

  1. Variable Highlighting
  2. Schema Editor
  3. Type Selection Improvements

Thanks LiveCyle & Workbech team…

Add comment July 5th, 2010

Conditional set value using XPath

In my quest to use XPath functions & expressions more efficiently in LiveCycle I managed to achieve ‘conditional set value’ yesterday.

Example scenarios:

  • Add some text to email body if some condition is true/false.
  • Add some text into T&Cs if certain product is selected.
  • In a generic/single Email or Set Value step you need to construct a big block of text. eg. Offer letter with certain paragraphs based on few conditions.

Approach 1: The usual way (or one of the usual ways):

An orchestration in Workbench with few setValue steps and few conditional routes to add/append the desired text to existing text.

And these steps need to be in certain order.

Approach 2: The XPath trick

I used substring() and number() function with pure XPath expression to construct conditional set value. See the usage below.

Example:

Consider a requirement in which you wish to send an email with few extra lines added to it if product A is ordered. And if contract term is 12 months then we need to add another T&C statement in the email body.

Let’s implement that with both approaches…

Approach 1: Few set value step and routing conditions to set process variables that get used in email body.
Process Diagram:
Set Value - Route condition approach

Set Value - Route condition approach

Email body:

Dear Provisioning Team,

Please send the below details to John.

System:{$ /process_data/@System $}
Agent Name:{$ /process_data/@Agentname $}
Product ordered: {$ /process_data/@Product $}

{$ /process_data/@ProductAConfigurationDetails $}

Terms and Conditions:
blah blah blah from Legal
adf
adf
{$ /process_data/@TCFor12MonthsContract$}
blah
blah

regards,
BOH Team

Approach 2: Conditional set value with XPath
Process diagram:

Set Value XPath approach

Email Body

Dear Provisioning Team,

Please send the below details to John.

System:{$ /process_data/@System $}
Agent Name:{$ /process_data/@Agentname $}
Product ordered: {$ /process_data/@Product $}

{$ substring(‘This is where the actual text gets put about the product configuration’,
50000000 * (number(/process_data/@Product !=’Product A’))
) $}

Terms and Conditions:
blah blah blah from Legal
adf
adf
{$ substring(’12 Months T&C content is written here or can be xpath expression’,
50000000 * (number(/process_data/@ContractLength !=’12′))
) $}

blah
blah

regards,
BOH Team

Explanation:

  • The above expression marked in blue puts the text in email body if the condition at the end of it fulfills.
  • By moving this logic into the email step itself I could clean up the process design significantly. I believe that LC is too good to do data transformation but common…few set value and few conditional routes for a simple text insertion?? I reckon the XPath trick gives much more cleaner approach to solve this.
  • First thing to notice in the expression is the use of a large number 50000000 . This is used to return blank substring value if the expression is false. Please adjust if your input text can be larger than this.
  • Second thing to notice is the use of comparison operator. I wanted to have 0 (zero) value for substring start value if condition is true. Boolean true is 1 so I’m using opposite operator. Eg. if(product=”Product A”) is represented as product!=”Product A”

As this is an XPath based expression we can use it in any LC component. I tried implementing if-else clause as well but that didn’t turn out well.

If you managed to read through this much then I’m sure you would love to see the undocumented ‘and’ ‘or’ keyword usage in XPath expression. I found that while experimenting and it’s an instant hit among few of my fellow LC users. It can be found here..

Let me know if you find this useful!!!!

1 comment November 27th, 2009

Form Pre-populate via Render service (delayed)

Hi All,

I was suppose to post easy techniques on how to pre-populate forms via LiveCycle’s Render service but unfortunately it is taking longer than what I expected. This is the story so far… Please comment if you are aware of this and enlighten me around the changed behavior.

Background:

I used the customized render service till LC 8.0.1 SP2 and what we get in dataDoc variable of the Render service is xdp data which had the whole form specific XML structure. But I’m finding that in LiveCycle 8.2 SP2 the dataDoc contains the xdp data but ONLY the Root element of form data is present.

The issue: This results in stalled operations (exception) as the elements that I want to populate does not exist.

The strange thing:

The most strange thing that I have seen is related to where the ‘caller’ orchestration was developed. So if your orchestration which has xfaForm variable was created on LC 8.0.1 then the dataDoc variable will have the xdp data with the whole and empty form data section in it. BUT….. if you touch that variable or re-create that xfaForm variable on LC 8.2 then you’ll start getting the blank form xml section in xdp data (of dataDoc) variable of render service.

Please let me know if anyone has seen this before and knows if this was intentional in LC 8.2 or it is a reported/unreported bug.

stay tuned for the pre-population.. I’ve decided to post a series of two articles to discuss the strategy that I think can work nicely.

Add comment June 10th, 2009


Categories

Recent Tweets

    Recent Posts

    Blogroll

    Tags

    The fine print!!

    The views on this blog are my own and don’t necessarily represent my employer's views, strategies or opinions.