Problem of permission when getting data from task (When making a task.refresh())

Hi everyone,

We’re in 7.1.3 with latest fixes for MWS and Task Engine for this version.

Some years ago, we implement your first workflow under 7.1.1 version, and well we implemented service packs and fixes as recommended.
In the fix : MWS_7.1.3_Fix14 we read :

And yes we get the case !
We set up the option in the server.properties.bat, but it seems to not resolve the case.
Here what we changed:


rem Custom java parameters, use -Doption=value format
set CMD_OPTIONS=-Dupdate.completed.task=true -Dtask.based.permission=false

So we think that we have to change the code behind your CAF application.

Here is the beginning of one code that is not broken. The line that cause the error is the second .refresh() the part we already resolved is the first one.
The error occured on .refresh() method.


public void searchForTasks() throws Exception
	//begin updtaed by mehrez 06/08/2010
	{//begin 0
		getInvoiceList().setInvoices(null);

		if (getSearchCriteria().getCompanyCodes().length == 0) {
			String summary = (String) getFireportportlet().getIntegrationProcess2Tasks().getApplicationResourcesProvider().getValue("search.select.company.code") ;
			FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN, summary, "") ;
			getFacesContext().addMessage((String) getClientIds().getValue("searchCriteria"), message) ;
		}
		else {//begin 1
			TaskSearchContentProvider searchProvider = new TaskSearchContentProvider();
			searchProvider.setSearchInbox(false);
			searchProvider.setAutoRefresh(false);
			searchProvider.getSearchQuery().setMaxResults(getFireportportlet().getMaxResults()) ;
			//27/12/11 -- Vincent DEBUG pour Permissions
			searchProvider.getSearchQuery().setCheckPermissions(false);
			//ENDVINCENT
			searchProvider.getSearchQuery().setTerms(buildSearchTerms().toArray(new TaskSearchQueryTerm[0])) ;
			searchProvider.refresh() ; // FIRST ALREADY RESOLVED
			ITask[] taskArray = searchProvider.getResults();
			for(ITask task : taskArray){ //begin 2
				ValidationforFIinvoice fiInvoice = new ValidationforFIinvoice() ;
				fiInvoice.setTaskID(task.getTaskInfo().getTaskID()) ;
				fiInvoice.refresh() ; // SECOND NOT RESOLVED
				if(fiInvoice.getTaskData() != null){ // begin 3
					InvoiceDetails invoiceDetails = initInvoiceDetails(task.getTaskInfo().getTaskID(), "FI", fiInvoice.getTaskInfo().getAssignedToList(), fiInvoice.getTaskInfo().getStatus(), 
							fiInvoice.getTaskData().getPublishableEDICanonical(), fiInvoice.getTaskData().getPublishableSAPCommunication()) ;
					String isItMyReport =null;
					try{
						isItMyReport=fireportportlet.getMyreport();
						if ((isItMyReport ==null)||(isItMyReport.equalsIgnoreCase(""))){
							isItMyReport ="NO";
						}
....... // HERE THE CODE CONTINUE //

For the first refresh we use the method .setCheckPermissions(false); from TaskSearchContentProvider
For the second we can’t use it because it’s TaskContentProvider and we don’t have same methods …

Why we try to do it ?
Because the history of processes / tasks is very huge and we need to work with elements before this fix and after the fix.
Also we need this fix to resolve some others points.

How can we do it ?
Thanks all.

Regards,
Vincent

There are a couple of things that i’d recommend looking into:

  1. Start mws in debug mode and look at the console. Ensure that the flag you set is being picked up by MWS.
  2. Since the first query isn’t an inbox query (via the code: searchProvider.setSearchInbox(false); ) i think that it might be entirely valid why the current user doesn’t have access to the subsequent task. That user probably isn’t assigned that task.

However, i’m sure that i don’t fully understand the use case, so i might be missing some details.

Regards,
–mark