12 Replies Latest reply on May 4, 2010 3:54 PM by statke

    Using Events

    kc@dafolo.dk Level 1

      Hi all,

       

      I have a simple one for you:

       

      I have a process that is long lived. In this process I want Task B to complete when Task A (which is in a gateway branch) is completed. I have added a Event Catch on my Assign Task and set up a filter that has

       

      MapContent/TaskID = /process_data/TaskResult/object/taskId

       

      TaskResult is a TaskResult object tat is set as the output of Task A.

       

      In the log I get the following errors when I run the process:

       

       

      2010-03-18 16:00:58,113 ERROR [STDERR] [Fatal Error] :1:1: Content is not allowed in prolog.

      2010-03-18 16:00:58,863 ERROR [STDERR] Mar 18, 2010 4:00:58 PM com.adobe.idp.event.filterengine.XPathFilterEngine evaluateXPath

      SEVERE: Filter evaluation failed /MapContent/TaskIDFor input string: "/process_data/TaskResult/object/taskId"

      2010-03-18 16:00:58,879 ERROR [STDERR] Mar 18, 2010 4:00:58 PM com.adobe.idp.event.filterengine.XPathFilterEngine evaluateXPath

      SEVERE: Filter evaluation failed /MapContent/TaskIDFor input string: "/process_data/TaskResult/object/taskId"

      2010-03-18 16:00:58,879 ERROR [STDERR] Mar 18, 2010 4:00:58 PM com.adobe.idp.event.filterengine.XPathFilterEngine evaluateXPath

      SEVERE: Filter evaluation failed /MapContent/TaskIDFor input string: "/process_data/TaskResult/object/taskId"

       

       

      Nothing happens with Task B when I complete Task A. I have tried to change the filter to something like:

       

      MapContent/TaskID = /process_data/str_myTaskId

       

      where str_myTaskId is a string that I have extracted from the TaskResult object. Still I get the above error...

       

      I don't really understand the error, what is wrong here?

       

      Thanks in advance

       

      Kim

        • 1. Re: Using Events
          Jasmin Charbonneau Level 4

          try to put a number() function around your xPath.

           

          For example MapContent/TaskID = number(/process_data/TaskResult/object/taskId)

           

          Jasmin

          • 2. Re: Using Events
            kc@dafolo.dk Level 1

            Hi again Jasmin,

             

            I have tested you rsuggestion, but now I get this error:

             

            2010-03-18 16:27:52,223 ERROR Mar 18, 2010 4:27:52 PM com.adobe.idp.event.filterengine.XPathFilterEngine evaluateXPath

            SEVERE: Filter evaluation failed /MapContent/TaskIDFor input string: "�"

             

            Something seems to be wrong with the taskId formatting from LC. However I have tried to write out the value to a string variable in LC and I get a correct taskId there

             

            Any thoughts on this?

             

            Thanks in advance

             

            Sincerely

            Kim

            • 3. Re: Using Events
              kc@dafolo.dk Level 1

              Hi again Jasmin,

               

              I have been investigating this issue for a couple of days now and I really can't seem to get it right.

               

              My process is simple:

               

              Task A is in a gateway or-wait branch with only one other branch. The other branch just sends out an email and passes through to the end of the gateway. After the gateway there is only the Task B that has two event catches - one for TaskCompletedWithData and one for TaskCompleted.

              event_process.JPG

              When I use your suggested filter I get the weird encoding for the taskID, but when I just write out the value to a string variable I get the correct number.

               

              What is wrong here - something seems to be an issue/bug with the events?

               

              Anyone out there that are using events with success?

               

              Thanks in advance

               

              Sincerely

              Kim

              • 4. Re: Using Events
                Jasmin Charbonneau Level 4

                I wonder if the event is received before the TaskResult is being set?

                 

                Maybe you can use a custom event after the Task A , and catch that custom event from Task B instead.

                 

                Jasmin

                • 5. Re: Using Events
                  kc@dafolo.dk Level 1

                  Hi Jasmin,

                   

                  Do you have any documentation or guide of how to create your own custom event?

                   

                  Thanks in advance

                   

                  Sincerely

                  Kim

                  • 6. Re: Using Events
                    Jasmin Charbonneau Level 4

                    I would check the Workbench help.

                     

                    In a nutshell, you right click on your folder and select New -> Event Type and specify the schema for the data. You can re-use the schema from an existing event and start from there.

                     

                    Jasmin

                    • 8. Re: Using Events
                      kc@dafolo.dk Level 1

                      Hi again Jasmin,

                       

                      I have done what you suggested (used the schema for TaskCompleted)- but when I add my custom event catch to the Assign Task B I get a NullPointer exception and my process of course stalls (the task B is never assigned to any body)

                       

                      I don't really know  why I get this NullPointerException:

                       

                      2010-03-25 16:31:10,617 ERROR TransactionRolledbackLocalException in method: public abstract java.lang.Object com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterLocal.doSupports(c om.adobe.idp.dsc.transaction.TransactionDefinition,com.adobe.idp.dsc.transaction.Transacti onCallback) throws com.adobe.idp.dsc.DSCException, causedBy:

                      com.adobe.idp.event.EventRuntimeException

                           at com.adobe.idp.event.subscription.SubscriptionManagerImpl.newCreateEventListener(Subscript ionManagerImpl.java:999)

                           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

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

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

                           at java.lang.reflect.Method.invoke(Unknown Source)

                           at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)

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

                           at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)

                           at com.adobe.idp.dsc.interceptor.impl.DocumentPassivationInterceptor.intercept(DocumentPassi vationInterceptor.java:53)

                           at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)

                           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:357)

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

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

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

                           at java.lang.reflect.Method.invoke(Unknown Source)

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

                           at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:237)

                           at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:158)

                           at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:169)

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

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

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

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

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

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

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

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

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

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

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

                           at $Proxy378.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:60)

                           at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStra tegyInterceptor.java:55)

                           at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)

                           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:60)

                           at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterc eptor.java:188)

                           at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)

                           at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)

                           at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptor ChainImpl.java:60)

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

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

                           at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessage Receiver.java:93)

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

                           at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:66)

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

                           at com.adobe.idp.event.client.EventServiceClient.newCreateEventListener(EventServiceClient.j ava:3981)

                           at com.adobe.idp.workflow.dsc.event.EventServiceAdapter.createListenerSubscription(EventServ iceAdapter.java:687)

                       

                       

                      Hope you can help me out.

                       

                      @Scott: Thanks for the link - I have tried to use it in my use of events. It seems like there might be a difference between the things that the documentation describes and how the actual implementation of the events are acting. However I am not sure. What I am looking for is an exact and precise explanation of how they work - not as they are intended to work (no offense intended by saying this). Any way thanks a lot both for your effort.

                       

                      Thanks in advance

                       

                      Sincerely

                      Kim

                      • 9. Re: Using Events
                        kc@dafolo.dk Level 1

                        Hi again,

                         

                        Today I tried changing my custom event throw with an event I am sure will not be called on the server at the moment (Task Deadlined). I set the catch on my Task B and get the following error in the logs. I am really confused by the behavior of events, please advice:

                         

                        What does this error mean? - I don't know what data I have provided to be corrupted or invalid...

                         

                         

                        2010-03-26 09:20:15,207 ERROR [com.adobe.idp.event.workmanager.AsynchronousEventExecutionUnit] Notifications will not be created. Reason:Data is corrupt or invalid.

                        2010-03-26 09:20:15,215 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract com.adobe.pof.GenericObject com.adobe.pof.omapi.POFObjectManagerLocal.writeObject(com.adobe.pof.GenericObject,com.ado be.idp.Context) throws com.adobe.pof.POFException, causedBy:

                        com.adobe.pof.POFRuntimeException: Object with key:[4,308] of object type: event is deleted and cannot be persisted.

                        at com.adobe.pof.omapi.POFObjectManagerImpl.writeObject(POFObjectManagerImpl.java:206)

                        at com.adobe.pof.omapi.POFObjectManagerRemoteBean.writeObject(POFObjectManagerRemoteBean.jav a:271)

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

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

                        at java.lang.reflect.Method.invoke(Unknown Source)

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

                        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:237)

                        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:158)

                        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:169)

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

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

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

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

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

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

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

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

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

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

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

                        at $Proxy393.writeObject(Unknown Source)

                        at com.adobe.pof.omapi.POFObjectManagerLocalEJBAdapter.writeObject(POFObjectManagerLocalEJBA dapter.java:135)

                        at com.adobe.pof.omapi.POFObjectManagerAbstractAdapter.writeObject(POFObjectManagerAbstractA dapter.java:223)

                        at com.adobe.idp.event.workmanager.EventExecutionUnit$5.doInTransaction(EventExecutionUnit.j ava:306)

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

                        at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doRequiresNew (EjbTransactionCMTAdapterBean.java:299)

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

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

                        at java.lang.reflect.Method.invoke(Unknown Source)

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

                        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionConta iner.java:237)

                        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionI nterceptor.java:158)

                        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstance Interceptor.java:169)

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

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

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

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

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

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

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

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

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

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

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

                        at $Proxy378.doRequiresNew(Unknown Source)

                        at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvi der.java:143)

                        at com.adobe.idp.dsc.transaction.impl.DefaultTransactionTemplate.execute(DefaultTransactionT emplate.java:79)

                        at com.adobe.idp.event.workmanager.EventExecutionUnit.deliverNotifications(EventExecutionUni t.java:279)

                        at com.adobe.idp.event.workmanager.EventExecutionUnit.deliverFailedNotifications(EventExecut ionUnit.java:393)

                        at com.adobe.idp.event.workmanager.EventExecutionUnit.execute(EventExecutionUnit.java:346)

                         

                        Thanks in advance

                         

                        Sincerely

                        Kim

                        • 10. Re: Using Events
                          Jasmin Charbonneau Level 4

                          Kim, I did some tests and I get the same result as you.

                           

                          Could you open a bug?

                           

                          Jasmin

                          • 11. Re: Using Events
                            kc@dafolo.dk Level 1

                            Hi again Jasmin,

                             

                            I will open a bug right away, thanks for testing out the issue.

                             

                            Sincerely

                            Kim

                            • 12. Re: Using Events
                              statke

                              Hi,

                               

                              I've done some tests and was able to make it work. Looks like exception regarding "corrupt event data" was getting logged because mandatory field for TaskDeadLined event instance was empty at run time.

                               

                              I changed the "throw TaskDeadlinedEvent" properties and added mapping as /MapContent/TaskID=1234 (just for testing purpose).

                               

                              After that, invoked the process again, found that TaskA and TaskB were in ToDo list.  Completed TaskA manually and found that TaskB also got completed automatically after couple of seconds.

                               

                              thanks,

                              santosh