Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Using Events

Avatar

Level 8
Level 8

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

12 Replies

Avatar

Level 10

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

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

Jasmin

Avatar

Level 8
Level 8

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

Avatar

Level 8
Level 8

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.

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

Avatar

Level 10

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

Avatar

Level 8
Level 8

Hi Jasmin,

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

Thanks in advance

Sincerely

Kim

Avatar

Level 10

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

Avatar

Level 8
Level 8

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(com.adobe.idp.dsc.transaction.TransactionDefinition,com.adobe.idp.dsc.transaction.TransactionCallback) throws com.adobe.idp.dsc.DSCException, causedBy:

com.adobe.idp.event.EventRuntimeException

at com.adobe.idp.event.subscription.SubscriptionManagerImpl.newCreateEventListener(SubscriptionManagerImpl.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.java:118)

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

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

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

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

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

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(EjbTransactionCMTAdapterBean.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(StatelessSessionContainer.java:237)

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

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.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(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:60)

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

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

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

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

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

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

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

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.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(AbstractMessageReceiver.java:93)

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

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

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

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

at com.adobe.idp.workflow.dsc.event.EventServiceAdapter.createListenerSubscription(EventServiceAdapter.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

Avatar

Level 8
Level 8

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.adobe.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.java: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(StatelessSessionContainer.java:237)

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

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.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(POFObjectManagerLocalEJBAdapter.java:135)

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

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

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTransactionCMTAdapterBean.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(StatelessSessionContainer.java:237)

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

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.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(EjbTransactionProvider.java:143)

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

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

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

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

Thanks in advance

Sincerely

Kim

Avatar

Level 10

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

Could you open a bug?

Jasmin

Avatar

Level 8
Level 8

Hi again Jasmin,

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

Sincerely

Kim

Avatar

Level 2

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