InfoPath Form Deleted from SPS Forms Library

  • 29 September 2005
  • 7 replies
  • 0 views

Badge +2
Hi,

I have created a InfoPath Process, which is started using IPC from a master process.

Everything works fine except for one problem - the first problem is that while the worklist is updated with this new activity when I submit the InfoPath form to complete the activity, the InfoPath form is deleted from the SPS Forms Library. I have unchecked delete temporary file but the file is still deleted.

Can anyone help with this problem.

7 replies

Badge +9
I am not aware of any issues around the InfoPath process templates that can cause this behavior, are you running K2.net 2003 SP2a?

The only thing that I can think of is:

Did you export the process from K2.net Studio after updating the settings?
Did you create a new process instance before verifying the existence of the document after the step was completed?
Badge +2
It seems I must not have exported the process because it now working. Thanks.
Badge +2
Hi,

Now the file is not deleted the contents of the file are not perserved. When I try to view the file contents the form appears blank.

When I submitted the form I didn't click the save button but only the submit button in the K2 task pane.

Is there some settings I'm missing?
Badge +9
During the configuration of the process you had to specify a initial location of the InfoPath document, the InfoPath Initialize activity makes use of this information to upload the document to the library specified, the client event also contains settings for the location of the document. During execution of the process the document will be uploaded to the settings specified for the InfoPath Initialize act. Once a client activity is encountered K2.net will make a copy of the document and upload the document to the locations specified for the client event, a copy of the document will be created for each destination used (2 Destinations = 2 copies, 10 Destinations = 10 copies ) each user works on his own unique copy. Once a user completes the workitem and the succeeding rule is true the process will continue, based on this you can see that only one of the copies was changed, the other remains unchanged. This can explain why the document is unchanged.

My suggestion 2 you:
1) Select the Delete Temp Files option.
2) In the last activity of your process, add a SPS Document event, and configure this event to upload the InfoPath XML Field (Process XML Field) to the desired document library.

The result: doing this will insure that only one copy of the document is available after the process is completed, and this is the latest version of the document.

Please let me know if this is helpful.
Badge +2
Hi,

Thanks for your response. I understand what you proposed and have tryed to implement it but with little luck. I have changed the process so the temp doc is deleted.

Now when I try to save the K2.ActivityInstanceDestination.XmlFields("K2InfoPathSchema").Value to the forms document library it saves the file but it's empty. When I print out the contents fo the K2.ActivityInstanceDestination.XmlFields("K2InfoPathSchema").Value variable it contains the data I ented in the InfoPath form.

I don't recieve any errors or exceptions.

Below is a snippet of code


' Set Credentials
Dim SpsUtils As New SourceCode.K2SPUtilities.SPSUtilities
SpsList.Credentials = SpsUtils.GetCredentials(Server)

Console.WriteLine("#$#$#$#$#$#$#$#$#$#$#$#$#$")
Console.WriteLine( K2.ActivityInstanceDestination.XmlFields("K2InfoPathSchema").Value )
Console.WriteLine("#$#$#$#$#$#$#$#$#$#$#$#$#$")

'Create oByte Array from XML Field
Dim oByte() as Byte
oByte = System.Text.ASCIIEncoding.ASCII.GetBytes(K2.ActivityInstanceDestination.XmlFields("K2InfoPathSchema").Value)

Console.WriteLine("oByte: " & oByte.ToString())
Console.WriteLine("Server: " & Server )
Console.WriteLine("Site: " & Site )
Console.WriteLine("Folder: " & Folder )
Console.WriteLine("File: " & File)

' Call Web Service to Upload Document
If Not SpsList.UploadDocument(Server, Site, Folder, _
File, oByte, True , ErrorMessage) Then
' Error Occurred in UploadDocument - Raise Error
Console.WriteLine("ErrorMessage: " & ErrorMessage )
Throw New System.Exception(ErrorMessage)
End If
Console.WriteLine( "Upload Complete" )


</my:FolioField><my:ViewFlowData></my:Vi
ewFlowData><my:ViewFlowURL>http://rhl-virtual-03:8081/k2v3/infopathservice/K2Vie
wFlow.aspx</my:ViewFlowURL><my:DestinationUser>CORP
htssm01,</my:DestinationUse
r><my:CreateViewFlowLink>True</my:CreateViewFlowLink><my:UseChachedViewFlowData>
False</my:UseChachedViewFlowData><my:DisableSubmitButtonDestination>True</my:Dis
ableSubmitButtonDestination></my:_K2></my:myFields>
Badge +9
The IP Activity updates the Process XML field once the activity is completed with the latest copy of the IP document, use the SPS Document event in an activity after the IP Client activity and upload the XML field on process level.
Badge +2
Thanks for the clarification - that did it.

Thanks again.

Reply