27 Replies Latest reply: Nov 23, 2007 12:52 PM by Jasmin Charbonneau RSS

    XML watched folder and process invoke

      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!
        • 1. Re: XML watched folder and process invoke
          Jasmin Charbonneau techies
          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
          • 2. Re: XML watched folder and process invoke
            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(FileScanJobIm pl.java:323)
            at com.adobe.idp.dsc.provider.service.file.scan.impl.FileScanJobImpl.processInputs(FileScanJ obImpl.java:127)
            at com.adobe.idp.dsc.provider.service.scheduler.scan.impl.AbstractScanJob.execute(AbstractSc anJob.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.jav a:181)
            at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:134)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
            at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
            at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:336)
            at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(Ej bTransactionCMTAdapterBean.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(StatelessSessionConta iner.java:214)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.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(EjbTransactionProvi der.java:104)
            at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInt erceptor.java:72)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
            at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateIntercep tor.java:37)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
            at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:88)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.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(AbstractMessage Receiver.java:88)
            at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:21 0)
            at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
            at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
            at com.adobe.idp.scheduler.callback.ServiceCallbackHandler.execute(ServiceCallbackHandler.ja va: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.jav a:210)
            at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor. java:134)
            at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:44)
            at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Transa ctionInterceptor.java:74)
            at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTr ansactionCMTAdapterBean.java:336)
            at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(Ej bTransactionCMTAdapterBean.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(StatelessSessionConta iner.java:214)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:149)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.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
            • 3. Re: XML watched folder and process invoke
              Jasmin Charbonneau techies
              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)?
              • 4. Re: XML watched folder and process invoke
                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....
                • 5. Re: XML watched folder and process invoke
                  Jasmin Charbonneau techies
                  I think the problem is with the watch folder endpoint settings.

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

                  Jasmin
                  • 6. Re: XML watched folder and process invoke
                    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. :-(
                    • 7. Re: XML watched folder and process invoke
                      Jasmin Charbonneau techies
                      That's fine. So now in your process, what is the type of the IN variable that you've defined?

                      Jasmin
                      • 8. Re: XML watched folder and process invoke
                        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!
                        • 9. Re: XML watched folder and process invoke
                          Jasmin Charbonneau techies
                          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
                          • 10. Re: XML watched folder and process invoke
                            Community Member
                            I've removed "in" and "req." property and it is still not working!
                            • 11. Re: XML watched folder and process invoke
                              Jasmin Charbonneau techies
                              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
                              • 12. Re: XML watched folder and process invoke
                                Community Member
                                ofcourse, here it is:

                                http://picasaweb.google.hr/stipe.pavicic/2
                                • 13. Re: XML watched folder and process invoke
                                  Jasmin Charbonneau techies
                                  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
                                  • 14. Re: XML watched folder and process invoke
                                    Jasmin Charbonneau techies
                                    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!
                                    • 15. Re: XML watched folder and process invoke
                                      Jasmin Charbonneau techies
                                      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?
                                      • 16. Re: XML watched folder and process invoke
                                        Jasmin Charbonneau techies
                                        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
                                        • 17. Re: XML watched folder and process invoke
                                          HowardTreisman CommunityMVP
                                          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+For m

                                          Regards,
                                          Howard
                                          http://www.avoka.com
                                          • 18. Re: XML watched folder and process invoke
                                            HowardTreisman CommunityMVP
                                            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
                                            • 19. Re: XML watched folder and process invoke
                                              Jasmin Charbonneau techies
                                              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
                                              • 20. Re: XML watched folder and process invoke
                                                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?
                                                • 21. Re: XML watched folder and process invoke
                                                  Jasmin Charbonneau techies
                                                  Which technique did you use to attach the image?

                                                  Jasmin
                                                  • 22. Re: XML watched folder and process invoke
                                                    Community Member
                                                    Thank you Howard for joining to this discussion and for your help and explanation of Avoka QPACK.
                                                    In my prosess I'll be droping XML and picture file to the watch folder and it should initiate my process. So far I've managed to merge XML and pdf form. But now, I have another issue. :-)
                                                    First of all I do not understand why I can not use under the Form Data Mappings for the User Component the same variable (initForm) as
                                                    Input form variable and Output form data?! It was possible in LC ver7!

                                                    Now my problem is that after I drop the xml it merges with the pdf form, but on the form I have another few fields on which uses is entering data and forwarding instructions to another user.
                                                    The problem is that the second user can only see the xml data, but not the data that previous user entered. Is it because of Render service of initForm variable? I think that it is rendereing this form from the beginning for each user...and I need to have a series of 6-7 users which will put their comment to the form...I think that the best way to do this is to have the same form variable which will be passed to the next user....??
                                                    Also I was trying for the first user to have for the Input form variable initForm, and for the Output form data secondForm variable, but it is also not working..

                                                    The problem with attachment I'll describe later because now xml and the data entered are back in first plan...
                                                    • 23. Re: XML watched folder and process invoke
                                                      HowardTreisman CommunityMVP
                                                      Hi
                                                      Sorry about the delay in responding.
                                                      We do this all the time.
                                                      One way is just to have a simple large text field, and have people adding to it. However, this relies on them not modifying the content that went previously, and also correctly recording their id and the date, etc.

                                                      We have built a component called Task History, which will automatically insert comments, date, time and user into a repeating area of a form, effectively recording a full audit trail of everyone who's touched the form.

                                                      Unfortunately, the documentation is a bit sparse at the moment, but you can see it here:
                                                      http://avoka.dnsalias.com:8800/confluence/pages/viewpage.action?pageId=1966151

                                                      If you have any questions, please email support@avoka.com

                                                      I'll try to get the docs updated asap, as well as some samples.

                                                      Howard
                                                      • 24. Re: XML watched folder and process invoke
                                                        Can you post some more details about the sample you created where "it all works"? Specifically, what services are being used and can you provide the endpoint settings.
                                                        • 25. Re: XML watched folder and process invoke
                                                          Jasmin Charbonneau techies
                                                          I think the discussion has touched several topics now. Are you looking for the endpoint settings form the watch folder.

                                                          What are you trying to do?

                                                          Jasmin
                                                          • 26. Re: XML watched folder and process invoke
                                                            Community Member
                                                            Jasmin thank you a lot for all the help and support you gave me when I needed it badly! The process is working now, and the customer is very pleased.
                                                            I had so many problems because of inadequate server the customer gave us at the beginning.
                                                            When I took another server everything was working just fine!
                                                            Now, when I'm watching at endpoints and configuration it all looks so simple and straightforward... :-)
                                                            • 27. Re: XML watched folder and process invoke
                                                              Jasmin Charbonneau techies
                                                              I'm glad to hear that Stipe. I know sometimes it's not easy to get started with LiveCycle, but once you get there it's pretty straightforward and very powerful.

                                                              Good luck in you next project.

                                                              I'm sure we'll talk again :) .

                                                              Jasmin