Error Opening Task from WorkSpace or Moss WebPart (after 0807 release install)

  • 26 September 2008
  • 11 replies
  • 8 views

Badge +5

Hi,


Today i upgraded our develpment environment to the new K2 (0807) version. Everything went ok with the upgrade of all K2 components.


The problem we are having is now related with trying to open a task either from WorkSpace or Moss WebPart, it doesn't open the Infopath form as used to, but instead gives the following message in a blank IE page:


 «Open InfoPath Task   
 The following error prevented the Workflow InfoPath Task to open:


The OpenAsWebPage is not valid. at SourceCode.Workflow.RuntimeServices.OpenInfoPathTask.NullRefChecks() at SourceCode.Workflow.RuntimeServices.OpenInfoPathTask.Page_Load(Object sender, EventArgs e) Void NullRefChecks()


Please contact your administrator»


Any ideas? Anyone have seen this already?


Thanks


11 replies

Badge +10

Thats a new one, looks like its trying to do something with Forms services, was this the case before?

Badge +5

Hi,


This was running ok with build 0803 on all of our 3 environments. As i said, since de update we are having this situation. Our tasks open on Infopath directy, so no web based forms.


Either new workflows started, or clicking on tasks already at users worklists before the update was done, now gives this error.


As i said, the error is coming after clinking to open a tasks both from Workspace and WebPart, and instead of opening Infopath it opens a blank IE page showing the error i mentioned and the URL pointing to WebService OpenInfoPathTask.asmx.


Both our test and production environments are working ok still with build 0803.


Thanks

Badge +10

Hi


 I'm experiencing the same issue and it appears there is a problem with the XOML code for the InfoPath Client event with BP 807.  The BP 807 InfoPath Client event generates an invalid worklist URL.  I'm still in the process of confirming the problem and the resolution but here is how I fixed it on my system.  


1.       Navigate to the  directory which contains your InfoPath Client Event XOML file where you have BlackPearl Studio installed.  It should be located in a directory similar to: 


C:Program FilesK2 blackpearlBinDesignTemplatesCSharpWindowsWorkflowExtender1033InfoPath.InfoPathClientEventItemEventItemAdditionalFiles


2.       Next make a backup copy of the @safeitemname@.xoml.cs


3.       Open up the @safeitemname@.xoml.cs 

 XOML file for your InfoPath Client event.  The problem appears to be in a function called SetWorklistUrl() in the #region private methods.   Here is the problem SetWorklistURL() code.  Note I’ve bolded the code that appears to be causing the problem:


 


        private void SetWorklistUrl()


        {


            string LibURL = "";


            string k2ServerName = GetK2ServerName(_k2Node);


 


            switch (_saveFormLocation)


            {


                case FormTemplateLocations.NetworkLocation:


                    goto default;


 


                case FormTemplateLocations.SPFormLibrary:                   


                    LibURL = GetFormLibraryUrl();


 


                    if (_openAsWebPage)


                    {


                        _worklistURL = General.CombineWebPaths(K2.Configuration.SaveFormSPSiteUrl, "_layouts/FormServer.aspx");                       


                        _worklistURL += "?XmlLocation=" + General.CombineWebPaths(LibURL, _fileName);


                        _worklistURL += "&DefaultItemOpen=1";


                    }


                    else


                    {


                        _worklistURL = General.CombineWebPaths(LibURL, _fileName);


                    }


                    break;


 


                default:


                    if (string.IsNullOrEmpty(k2ServerName))


                    {


                        throw new Exception("The Workflow Server name could not be retrieved from the InfoPath form's corresponding XML field.");


                    }


 


                    _worklistURL = string.Concat(_infoPathWebServiceSiteUrl, "?K2Server=", k2ServerName, "&SN=", K2.SerialNumber, "&XmlFieldName=", _xmlFieldName);


                    break;


 


            }


 


            _worklistURL = string.Concat(_infoPathWebServiceSiteUrl,


                "?K2Server=", k2ServerName,


                "&SN=", K2.SerialNumber,


                "&XmlFN=", _xmlFieldName,


                "&Lib=", LibURL,


                "&OpenAsWebPage=", _openAsWebPage,


                "&SPURL=", K2.Configuration.SaveFormSPSiteUrl,


                "&Single=", _isSingleInstance.ToString());


        }


4.       Comment out the bolded code so that the function appears like:


        private void SetWorklistUrl()


        {


            string LibURL = "";


            string k2ServerName = GetK2ServerName(_k2Node);


 


            switch (_saveFormLocation)


            {


                case FormTemplateLocations.NetworkLocation:


                    goto default;


 


                case FormTemplateLocations.SPFormLibrary:


                    LibURL = GetFormLibraryUrl();


 


                    if (_openAsWebPage)


                    {


                        _worklistURL = General.CombineWebPaths(K2.Configuration.SaveFormSPSiteUrl, "_layouts/FormServer.aspx");


                        _worklistURL += "?XmlLocation=" + General.CombineWebPaths(LibURL, _fileName);


                        _worklistURL += "&DefaultItemOpen=1";


                    }


                    else


                    {


                        _worklistURL = General.CombineWebPaths(LibURL, _fileName);


                    }


                    break;


 


                default:


                    if (string.IsNullOrEmpty(k2ServerName))


                    {


                        throw new Exception("The Workflow Server name could not be retrieved from the InfoPath form's corresponding XML field.");


                    }


 


                    _worklistURL = string.Concat(_infoPathWebServiceSiteUrl, "?K2Server=", k2ServerName, "&SN=", K2.SerialNumber, "&XmlFieldName=", _xmlFieldName);


                    break;


            }


 


            //_worklistURL = string.Concat(_infoPathWebServiceSiteUrl,


            //    "?K2Server=", k2ServerName,


            //    "&SN=", K2.SerialNumber,


            //    "&XmlFN=", _xmlFieldName,


            //    "&Lib=", LibURL,


            //    "&OpenAsWebPage=", _openAsWebPage,


            //    "&SPURL=", K2.Configuration.SaveFormSPSiteUrl,


            //    "&Single=", _isSingleInstance.ToString());


 


        }


5.       Save the changes made to the file @safeitemname@.xoml.cs.


6.       Any new InfoPath Client event activities will now use the modified XOML file that we changed in the previous steps.  Note any existing InfoPath activities created with BP 807 can be updated to use the changed XOML file by right mouse clicking in BP Studio and choosing to Update Design Templates.  You can then choose to update the InfoPath Client Event templates (note you’ll lose any code modifications you might have made to those templates) and it will then import the modified XOML file for use when deployed.

Badge +10

Thanks Tim,


 


Jarrostick, can you give this a try and let us know?

Badge +5

Hi guys,


Tim i read your reply and although i understand your idea, actually it doesn't quite solve my problem.


Before i upgraded to 0807, i already had several processes deployed (with 0803) and for those some workflows running and so a couple of active tasks.


So forgetting K2 Studio, even if we have that problem you mention on the Infopath Client Event XOML, at least for my old deployed processes and the "old" active tasks, i should be able to open them from Workspace or WebPart...and the fact is that i can't.


For those "old" tasks the URL that appears on the blank IE page seems correct:


http://k2console.wdgo.pt:8081/RuntimeServices/OpenInfoPathTask.aspx?K2Server=NTV29&SN=1167_54&XmlFieldName=P2x1x2Form1C


The problem i would say is on the OpenInfoPathTask WebService or something called from there...


Note: Commenting the code you say would only make sense for new deployed processes, but even then it would produce the same error i have when opening the tasks.

Badge +10

***  Just an update to this post.  K2 has confirmed that there is an issue where the Out of Office changes in 807 will cause InfoPath Client events to always open in the InfoPath rich client instead of Form Services.  K2 is working on a patch to release shortly to resolve the problem.


 


Please note that the approach that I took actually comments out code in the InfoPath Client Event that was added to support the new Out of Office capabilities in 807.  So while the InfoPath Client events will open in Form Services commenting out the code will lead to problems when using the BP 807 Out of Office capabilities.  It is recommended in production environments using InfoPath Form Services to hold off installing BP 807 until the patch is available.

Badge +10
You're correct, this does sound like a different problem than what I described.  I would recommend opening a support ticket if you haven't already
Badge +9
Can anyone confirm that this issue has been addressed in the subsequent 0807 updates?  I applied the updates, but still seem to have this problem but I can never rule out that I am just doing something wrong.
Badge +2

We had a similar error that was resolved by applying the 2nd 0807 update and adding the MOSS server to the list of services the Workspace app pool identity can delegate to (which we didn't have configured with 0803 and the form opened fine). 


 

Badge +5

Hi,


The initial issue i posted on this thread is in fact solved applying the lastest fix package (330). Now our infopath forms open in the fat client (Infopath) without any problems.


We still have an issue though, with the Infopath Client Event Wizards in the step where it asks whether we want to save the task forms. Both in our previous developed processes and in new ones we cannot select the option "Do not save forms" and so it forces us to point to a sharepoint library, something we clearly don't want to.


I've a ticket open for this later issue.


Regards,

Badge +6

A new KB has been posted that explains the functionality changes in 807.


http://kb.k2workflow.com/Articles/KB000351.aspx


This topic is covered in there:


INFOPATH TEMPORARY FILE FUNCTIONALITY
In pre-0807 releases, a temporary InfoPath file was created for client events. In 0807 this no longer occurs due to the additional OOF functionality and the potential that required data is unknown at the time the activity instance is created. Browser-enabled forms require a temporary file, however, and this is created when the worklist item is opened. If you need temporary files created prior to that, you can uncomment the code in the design template.
Look for it in the uploadInfoPathFile_ExecuteCode function in the design template. Note, however, that creating the temporary file in this manner will disable the OOF functionality for the client event and will also require changes to the SetWorklistUrl to point to the location of the temporary file. This is not recommended.


This means that the functionality you require is now default behavior. You have to update the design templates of all InfoPath client events to reflect this change. Note that now you do not have any option for saving the temporary file when using browser based forms.


HTH

Reply