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.

How can I test process if a process takes an object as input?

Avatar

Former Community Member

For example,

In PetVerification, the input variable is Pet object. How can set the pet object to test the process?

I tried to set "<Pet><name>test</name></Pet>" to pet value bar, but I am getting following error:

ALC-DSC-119-000: com.adobe.idp.dsc.util.InvalidCoercionException: Cannot coerce object: <Pet><name>test</name></Pet> of type: java.lang.String to type: class com.petstore.model.Pet

Thanks,

6 Replies

Avatar

Level 10

Where do you get this example from?

If the process takes a PetObject as an input parameter, you need to provide a PetObject.

If you give it a string, then you're going to get a coercion error which is basically I can't convert this type over to this other type.

Jasmin

Avatar

Former Community Member

This process either came from workbench or the petstore example from mate framework web site.

I was wondering how i can provide an object to the process under lc workbench.

Thanks,

Avatar

Level 10

It must be coming from the framework web site.

Bottom line the data type has to exists. When you create a new variable scroll down to the bottom of the list and select "Find Type" and do a search.

If it doesn't find anything then you can't use that data type you need to install. I might have come with an LCA if that's what you use to install this sample.

Jasmin

Avatar

Former Community Member

The process itself works, I test this with the petstore example that they provided.

The reasons I wanted to find out how to test process with an objecgt as input, because we deployed our own components. One of the compoent takes an object as input.  We aren't sure if the we deployed the component correctly or not.  and we want to test this on workbench.

Avatar

Level 10

Are you trying to test from within Workbench (right click on process/Invoke)? If that's the case the Workbench interface won't be able to display that data type in the input or output screen when you invoke.

When you set a variable to be an input variable, it's not so that you can use it as an input for a particular step. It's to use it an in input parameter for the entire process. So just don't make you variable a input parameter, set it using a setvalue an then invoke.

Jasmin

Avatar

Level 8

If you want to use a custom object inside of a LiveCycle process then you need to create a custom component and declare that object using the data-type tag in the new component's component.xml file.  I wrote a couple of articles on this a while ago.  They may help you out.

http://www.adobe.com/devnet/livecycle/articles/dsc_development.html

http://www.adobe.com/devnet/livecycle/articles/dsc_development_pt2.html