Task Portlet initialize method

[size=“16”]Hi,

I’m having trouble understanding the event model of the portlets that are created using designer when implementing a human based task. I’m using the WebMethods 7.1 Suite.

I used to believe that the Initialize method that is already created when you create a portlet is fired when there is a “page load

Check this link

http://tech.forums.softwareag.com/viewtopic.php?t=15926&fstart=100&sid=b66aa91a79a95d6e1f79a46c2a5da90b

It is designed that way…

Beans are supposed to be run once as needed. I ran into caching issues and they formally fixed it but didn’t fix it for other parts of the form that had more complicated child datasets/methods and their option is to clean out the values upon load of the page. i.e. what I do is check to see if the task(conflict id) is the same and if not then empty out the values in the initialize methods public String initialize() {
relPartys=null;
propertys=null;
environmentsDataList=null;
patents=null;
trademarks=null;
finders=null;
adverseParties=null;
lawFirms=null;
clients=null;
resolveDataBinding(INITIALIZE_PROPERTY_BINDINGS, this, “initialize.this”, true, false);
return OUTCOME_OK;
}

beforeRenderResponse() is not working out

Both the task IDs are coming out same. So I’m able to execute my condition.
----------------------CODE SNIPPET-------------
protected void beforeRenderResponse() {
super.beforeRenderResponse();

//get new task Id
String newTaskID = (String)resolveExpression("#{activePreferencesBean.taskID}");

//check if we are in a new task
if (newTaskID!= null && !this.getAviationInvoice().getTaskID().equals(newTaskID))
{
this.initilizeAuditTrail();
}

// force refresh of the Task Content Provider
getAviationInvoice().refresh();

if the task ids are the same, then that means they’re the same task instances. if you want to do different initialization for the same task instance, I think you probably can use the business data to determine how to initialize the instance according to the current process step.

Thanks Wen!

But the issue is I need to invoke a WS call on IS on the initialization of the each Task Instance. And in my case initialize() function is not working. And above function, beforeRenderResponse() was suggested by one of the forum member.

Thanks,
Jaimin

Open an SR ticket - I had similiar problem - it was w/ data not web services specifically and as mentioned above workaround and here is the patch I think they released for it in fix #:
1-1VWMAR : In My webMethods Server, Web services do not update correctly.
It is part of the MWS_7-1-2_Fix6

Also to get the other fixes that were aligned with this were:
MWS_7-1-2_CL_Fix6.zip
TE_7-1-2_Fix2.zip

but I am sure if you get the latest it will fixes it will resolve the issue. Do you have ‘auto-refresh’ forced to true / ‘needs refresh’ to true? don’t know about the ‘needs refresh’ specifically but i know the auto refresh needs it. You probably have it set but just needed to ask.