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.

XML watched folder and process invoke

Avatar

Former Community Member
hello,



We are trying to create an application that will merge XML data and pdf form and initiate workflow.

Is it possible with existing components (without need for customization) to

create an process in which we deploy XML files in watch folder and after that the form with populated XML data will occur in "to do list" of particular user?

If you could describe some details I would appreciate!
27 Replies

Avatar

Level 10
This is definitely possible without customization.



The first thing you need to do is build a process that has an IN variable of type Document.



Then set a watch folder endpoint on that process so you can drop the file on the file system. It'll then populate the IN variable of type Document with the content of the file (xml). You need a document variable for later when using LC Forms, otherwise you could use an XML type.



In your process, you'll need to create a variable of type xfaForm and initialize it to point to your xdp in the resource tab. This is the form the user will see in workspace. Also you'll want configure the render service (under Advanced Settings) to point to the Sample Forms/ RenderPDFForm. Set the data parameter to be the document variable that contains the xml. If the xml is in the right structure, then it should populate your PDF properly.



The last step is to add a User operation and assign the xfaForm for the Input Form variabale.



Jasmin

Avatar

Former Community Member
Hello, for all the advices you've posted but I got an error.

Here's the log from the watched folder. Is it possible for you to

create an lca file and post it...from your explanation it seems like

this is an easy job to but for me it is quite tricky.. I need it to understand the principles of the endpoints. I'm still little confused with it..



Thank you



The log file:



Failure Time----Mon Sep 10 16:38:45 CEST 2007

source location ---- Reason of failure is-----Failure to invoke the job Mikrocop

Failure to invoke the job Mikrocop

Invocation error.

javax.jms.JMSException: Could not create a session: javax.resource.spi.CommException: javax.naming.NameNotFoundException: XAConnectionFactory

Could not create a session: javax.resource.spi.CommException: javax.naming.NameNotFoundException: XAConnectionFactory

ALC-DSC-600-000: com.adobe.idp.dsc.provider.service.scheduler.impl.SchedulerRuntimeException: Failure to invoke the job Mikrocop

at com.adobe.idp.dsc.provider.service.file.scan.impl.FileScanJobImpl.invokeJob(FileScanJobImpl.java:323)

at com.adobe.idp.dsc.provider.service.file.scan.impl.FileScanJobImpl.processInputs(FileScanJobImpl.java:127)

at com.adobe.idp.dsc.provider.service.scheduler.scan.impl.AbstractScanJob.execute(AbstractScanJob.java:56)

at sun.reflect.GeneratedMethodAccessor497.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:181)

at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:134)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:74)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTransactionCMTAdapterBean.java:336)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(EjbTransactionCMTAdapterBean.java:212)

at sun.reflect.GeneratedMethodAccessor358.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.invocation.Invocation.performCall(Invocation.java:345)

at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)

at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)

at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)

at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:363)

at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)

at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)

at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)

at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)

at org.jboss.ejb.Container.invoke(Container.java:873)

at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)

at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)

at $Proxy196.doSupports(Unknown Source)

at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvider.java:104)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInterceptor.java:72)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)

at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateInterceptor.java:37)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)

at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterceptor.java:88)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)

at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:113)

at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:102)

at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:88)

at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:210)

at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:57)

at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)

at com.adobe.idp.scheduler.callback.ServiceCallbackHandler.execute(ServiceCallbackHandler.java:87)

at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)

Caused by: ALC-DSC-003-000: com.adobe.idp.dsc.DSCInvocationException: Invocation error.

at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:210)

at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:134)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:44)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:74)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTransactionCMTAdapterBean.java:336)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(EjbTransactionCMTAdapterBean.java:212)

at sun.reflect.GeneratedMethodAccessor358.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.invocation.Invocation.performCall(Invocation.java:345)

at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)

at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)

at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)

at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:363)

at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)

at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)

at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)

at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)

at org.jboss.ejb.Container.invoke(Container.java:873)

at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)

at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)

at $Proxy196.doSupports(Unknown Source)

at com.adobe.idp.dsc.transaction.impl.e

Avatar

Level 10
This doesn't seem like a watch folder issue. If it's a watch folder issue you would see a file in the error folder.



Sending the lca won't help much since it doesn't carry the end point information.



Just create a simple process with one operation. Perhaps a setValue operation. Save and Activate and we'll work from there.



Also can you tell me what are your watch folder end point configuration settings?



What is you environment (App Server, DB, OS)?

Avatar

Former Community Member
maybe it does not seems to be as a watched folder issue, but this is copied from a log file which I found in a watched folder under sub folder error.



I'm running LC on jBoss server, mySQL, WinServer 2003



right now, I'll send you other watch folder end point configuration settings later in the morning (and this is for about 8 hours ;-) )



Thank you A LOT for your help, hope we'll manage this somehow....

Avatar

Level 10
I think the problem is with the watch folder endpoint settings.



So I'll wait until you post the configuration settings.



Jasmin

Avatar

Former Community Member
I've entered the path for the watched folder and of course all the other folders are created by the system such as (input, failure, result, preserve, stage).

After I chosen Operation name to be "invoke" I had to configure input parameter mappings, so for the variable IN I've entered *.xml value (so it is looking for any xml file to assign to IN variable)... I would send you the PrintScreen shots, but I can't send it to the forum. :-(

Avatar

Level 10
That's fine. So now in your process, what is the type of the IN variable that you've defined?



Jasmin

Avatar

Former Community Member
I'm so sorry Jasmin for not replying, but all these days I was trying do

figure out how to create this process, but it simply does not work.

I was trying to combine your advices from another topic I've also posted, and could you be so kind and visit:



http://picasaweb.google.hr/stipe.pavicic/LiveCycleESWatchedFolder



I've just uploaded PrintScreen from Workbench and adminui.

I realize it is so simple task, but still it is not working... grrr!



Is this process working on your comp?



BTW. I've also putted the button on the form with importData() command and it import XML to the form! So the XML data and the pdf form are working well together.



Thank you for all your help!

Avatar

Level 10
You have two IN/Required variables: initForm and IN but seems that you're only dropping one file in the watch folder (by looking at the watch folder settings). That would create a problem since it expects two.



Remove the "in" and "required" property of the initForm variable and see if that gets you through.



Jasmin

Avatar

Former Community Member
I've removed "in" and "req." property and it is still not working!

Avatar

Level 10
Can you just go back to the watch folder endpoint configuration page and make sure the binding is updated accordingly.



Can you post the picture on you Picasa web site and the updated error log?



Jasmin

Avatar

Level 10
I just created a similar application from scratch. I created a new process with only 1 user operation. Then created two variables 1 document and 1 xfaForm. Set the document variable to be IN.



The created a watchfolder end point and it all worked.



Im starting to wonder if there was a problem with your installation.



Jasmin

Avatar

Level 10
From Stipe:



Hello Jasmin!



I've imported your archive file, and created an watch folder endpoint, but

it again is not working!!!

I'm just installing another win server2003, and I'll install new LiveCyce server..

I'll send you the results!



But during the installation of LC on this present server, everything went just fine!

without any error.....It's really strange..



Thank you 1again, and I'll keep you informed!

Avatar

Level 10
Hello Jasmin!



I just want to inform you that the process is finally working!!!

Thank you a lot!



but now, I have another question. In the watch folder I'll be dropping

2 files, one is the xml and another will be the picture. I want to

populate the form with xml data (now we finally got this working) and the

picture should be attached to the form.

Now, I was at Avoka website and for the version LC 7 they have an

QPACK "Attach file".

Now, is the attaching process standard functionality of ES or we must

tell to the customer that they have to buy this qpack?

Avatar

Level 10
You dont need to buy another qpac to do that. Go under the Attachments and Notes section on the User operation. Select the option Copy all notes and attachment from and then specify a list variable that contains the attachments.



Add a set value operation to be the first step in your process and use xPath to add the image from the image variable to the list using something like /process_data/myList[1] = /process_data/@myImageVar



Jasmin

Avatar

Level 9
Hi Stipe



Actually, the Avoka AttachFileToTask attaches a file to a task, rather than to a the Form itself, so this won't help you.



If you want to attach a picture to a form, you can either:

1. Use the LC Forms component to attach a file when you do the Render operation.

2. Create an ImageField on your form, and use Avoka's LC-ES ImageInserter to insert the image directly into the data of the form, and then bind it to your Image Field. This way the image will appear inside your form, rather than attached to it.

http://avoka.dnsalias.com:8800/confluence/display/Public/How+to+Insert+an+Image+into+a+Form



Regards,

Howard

http://www.avoka.com

Avatar

Level 9
PS Jasmin, from Stipe's use-case, it appears to me that he wants the picture to be attached to the Form itself, rather than as an attachment to a task in Workspace.



However, I may be wrong, and Stipe may be using a User step in his workflow, in which case your solution is obviously correct.



Stipe, please confirm.



Regards,

howard

Avatar

Level 10
You might be right Howard.



I might have assumed it was to the task but when I re-read it, it seems that he wants to attach it to the PDF.



Jasmin

Avatar

Former Community Member
Hello, Jasmin.



I've managed to attach the file to the form. But it

gives to the attachment another name... :-)

for example it gives the numbers 123214145-45.pdf ...



is it possible to maintain the original name of an document?