ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Assertion Failure on calling activityInstance on a WorkItem

Post new topic  Reply to topic
 Assertion Failure on calling activityInstance on a WorkItem « View previous topic :: View next topic » 
Author Message
asitschwab
PostPosted: Fri Mar 23, 2007 11:08 am    Post subject: Assertion Failure on calling activityInstance on a WorkItem Reply with quote

Newbie

Joined: 23 Mar 2007
Posts: 3

Hi Everyone,

I hope you find folks can confirm a possible solution for me.

Scenario:

We're in the process of migrating an application from BEA/Solaris to WebSphere/Linux and in the process switched to run MQ Workflow 3.6 FROM 3.5 on AIX. We switched to run the new "native Java API" (fmcjapi.jar) instead of the binary native libraries (fmcojagt.jar) in 3.5.

Problem:

We ran into problems when the code calls the "activityInstance" method of a WorkItem in an attempt to force the restart of a work time during a work item reassignment.

Symptom:

The code fails with the following error. The error DOES NOT occur when we run using the 3.5 API, but does fail with the new 3.6 native Java API.

The Error and Stack:

SystemOut O -------------------------- Assertion Failure ----------------------------
SystemOut O
SystemOut O Precondition violation !(ActInstIDIsNull() == false) in method >> at com.ibm.workflow.client.util.msg.f
mcmtwit.FmcWorkItemData.ActInstID(FmcWorkItemData.java:178 <<
SystemOut O
SystemOut O -------------------------------------------------------------------------

com.ibm.workflow.client.util.FmcAssertionError: Precondition violation !(ActInstIDIsNull() == false) in method >> at com.ibm.workflow.client.util.msg.fmcmtwit.FmcWorkItemData.ActInstID(FmcWorkItemData.java:178 <<
at com.ibm.workflow.client.util.FmcAssert.precondition(FmcAssert.java:192)
at com.ibm.workflow.client.util.msg.fmcmtwit.FmcWorkItemData.ActInstID(FmcWorkItemData.java:178)
at com.ibm.workflow.client.api.FmcWorkItem.activityInstance(FmcWorkItem.java:429)

Analysis:

Using javap I was able to disassemble the FmcWorkItem (fmcjapi.jar in new native java API) and the WorkItemImpl types in the OLD fmcojagt.jar to see the difference. It's obvious that the FmcWorkItem checks to see if the activity instance id was null or not while the old classes do not.

I reviewed the programming guide for 3.6 MQWF and the guide did elude to the fact that the "old" C/C++ binary API behaved differently in terms of the ActivityInstance.

Question: Does anyone know if this is a fundamental difference between the 3.6 "native Java API" and the 3.5 "binary" API?

Possible Solution:

After going through the programmer's guide and trial/error, expriments, etc. I found that adding a call to "persistentOidOfActivityInstance" on the work item, PRIOR to retrieving the Activity Instance seems to resolve the error. I am assuming that the call to persistentOidOfActivityInstance initializes the activity instance ID on the work item as well as returning the ID.

This was NOT obvious and NOT really well documented in the programmer's guide so I need some confirmations and reassurance.

BIGGG QUESTION IS

Is this the proper procedure for getting the Activity Instance from a work item? Meaning, do we NOW have to call persistentOidOfActivityInstance to initialize the Activity instance ID prior to calling activityInstance to get the Activity Instance object?

The code that seems to work:

public Date forceRestartWorkItemActivity(String workItemId)
throws ConnectionException {
try {
WorkItem workItem = persistentWorkItem(workItemId);
// Calling persistentOidOfActivityInstance seems to
// fix the problem with AssertionErrors that occur
// when we call the activityInstance.
workItem.persistentOidOfActivityInstance();

ActivityInstance activityInstance = workItem.activityInstance();
activityInstance.forceRestart();

return activityInstance.lastModificationTime().getTime();
} catch (FmcException e) {
throw new ConnectionException("Couldn't force restart workItemId " + workItemId, e);
}
}


[b]Any advice, comment is GREATLY appreciated.


Thanks,

Alan
[\b]
Back to top
View user's profile Send private message
jmac
PostPosted: Fri Mar 23, 2007 12:11 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

Alan:

Try adding the following after you recreate the workitem using the call to persistentWorkitem
Code:
workitem.refresh();

I believe it is possible that the issue is the workitem object is not entirely there. I have run into similar issues reconstituting other objects using the ExecutionServer.persistentxxx() methods.

I also think that this may be a bug.
_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
asitschwab
PostPosted: Fri Mar 23, 2007 12:23 pm    Post subject: Reply with quote

Newbie

Joined: 23 Mar 2007
Posts: 3

Thanks JMAC,

I will give that a try. I'll post my results.

We have a PMR opened with IBM on this issue. We're basically asking the same thing I'm asking here.

-Alan
Back to top
View user's profile Send private message
asitschwab
PostPosted: Fri Mar 23, 2007 2:19 pm    Post subject: Reply with quote

Newbie

Joined: 23 Mar 2007
Posts: 3

JMAC,

Your suggested ALSO worked. I used the "refresh" call instead and was able to reassign the work item.

So what does "refresh" do specifically. I think this is the solution I was looking for but I need to know more about what it does and the programming guide's not much help.

I can understand why "refresh" would work but why does the "persistentOidOfActivityInstance" also work. So what's supposed to be the function of the call to "persistentOidOfActivityInstance"? It seems to do more than advertised.

Your thoughts are appreciated?

Thanks again,

Alan
Back to top
View user's profile Send private message
jmac
PostPosted: Fri Mar 23, 2007 3:15 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Jun 2001
Posts: 3081
Location: EmeriCon, LLC

Alan:

The refresh() method causes all secondary attributes to be fetched. According to the doc, as I read it, it appears that the method you want to use is primary, and should be accessible directly. In any case since 3.4 I believe the refresh() is supposed to be automatic. HOWEVER, I ran into a problem with I believe the Person object several years ago, that sounded very similar to what you are experiencing, and my solution was a refresh(). I am pretty certain I had opened a PMR on this, which was likely closed to my satisfaction, but like I said this was years ago, so I do not have the records easily accessible.

I assume IBM will be able to help you with this.

GOOD LUCK
_________________
John McDonald
RETIRED
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » Assertion Failure on calling activityInstance on a WorkItem
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.