K2 [BlackPoint] - A simple meeting agenda review process in InfoPath… that can even store the completed InfoPath form

Well, I say simple… It is simple to me, as I’ve knocked it up using the Meeting Agenda template (free with InfoPath 2007) with a slight addition of a task action field, and I’ve then knocked together a simple approval and rework based workflow.

k2blackpointdemoprocess_001 
Figure 1: The finished workflow (I’m not going to teach you guys how to suck eggs by going through the creation of it… unless you’d like me too … another time perhaps?)

Figure 1 shows the finished article… I’m not suggesting that this is perfect example of an approval and rework workflow…  it is simply here to demonstrate a point.

k2blackpointdemoprocess_002
Figure 2: Destination Form Library for the creation of the InfoPath form that starts the workflow

I’m using a standard MOSS 2007 form library to store my InfoPath forms as shown in Figure 2. When ‘New’ is clicked, you see Figure 3.

k2blackpointdemoprocess_003
Figure 3: The InfoPath form created when ‘New’ is clicked in Form Library (FormLibrary001)

k2blackpointdemoprocess_004  
Figure 4: The K2 Worklist (which just happens to be in the Process Portal (K2 Management)) showing the new task for destination user ‘Administrator’

As you can see in Figure 4, a task is added to the administrator user task list.

k2blackpointdemoprocess_005 
Figure 5: Clicking on Open will take the user back into InfoPath, or the Actions option will allow the user to action the task bypassing InfoPath - this might be useful if you want people to bulk action things. In this example I should really disallow this option. You can do this as part of the InfoPath client event outcomes.

k2blackpointdemoprocess_006
Figure 6: Shows the opening of the InfoPath form from the K2 BlackPoint runtime services… I’ve configured this on port 8080 (just so you know). This gives me a clue that unlike K2 BlackPearl, InfoPath forms only exist in K2 Server, and not in the form library… which confused me somewhat… or perhaps I’ve got the wrong end of the stick on that.

k2blackpointdemoprocess_007 
Figure 7:  User is able to select an outcome from the task action field as you’d expect

k2blackpointdemoprocess_008
Figure 8: Shows the final resting place of the InfoPath form - this is because of the SharePoint document event I placed in the final activity. I assumed the form would be saved by default, but it doesn’t seem to work that way… but it certainly did in K2 BlackPearl.

So how did I get the InfoPath form to be stored in the Library at the end… well the next screen shots and explanations will tell you how! I must admit, I thought it would do this automatically, but both the Beta 2 and RC versions of K2 [BlackPoint] behave in this way…

As you may have noticed in Figure 1, I added a SharePoint document event to the end of my workflow. This is also shown in Figure 9.

k2blackpointdemoprocess_009
Figure 9: Shows the SharePoint document event on the final activity that saves the InfoPath form. I’m using the Upload Document Event Action.

k2blackpointdemoprocess_010
Figure 10: Shows that I’m going to be creating this uploaded file from a K2 Field. This is very important, as K2 BlackPoint is now being told that the file stream is not from a disk, but from the database

k2blackpointdemoprocess_011
Figure 11: When selecting the K2 Field, be sure to select the Root node of your InfoPath form. The Root node will be the name of your Template (in most cases). My Template XSN was called MeetingAgenda001.xsn before it was integrated into the workflow.

k2blackpointdemoprocess_012
Figure 12: I am building the Filename of the output file using the meetingTitle field from my InfoPath template

k2blackpointdemoprocess_013
Figure 13: To ensure an unique filename, I utilise the Process Instance ID

k2blackpointdemoprocess_014
Figure 14: Be sure to space out your dynamic fields, I’ve used a hyphen. Also be sure to add the extension to the end. For InfoPath, the extension required is ‘.xml’ (well, of course it is!)… You then end up with files named like they are shown in Figure 8

Of course, you may not have to do all this stuff… I might have an incorrectly set-up version of K2 [BlackPoint], but thinking about it, it does make sense to me.

  1. InfoPath forms are ‘protected’ from unauthorised modification as they are stored in the database
  2. InfoPath forms are only stored in the library when they are in a complete state (because you decided when they would be stored!)

This is definitely an improvement on how BlackPearl handles them, as they are editable (through other means… e.g. text editor) when they are mid workflow, and it was a concern of the customer.

Anyways, I hope this helps others understand how to do this sort of thing. Post a comment if you want more explanation on anything, but of course, check out K2 Underground first!

SpittingCAML




You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Responses to “K2 [BlackPoint] - A simple meeting agenda review process in InfoPath… that can even store the completed InfoPath form”

  1. Paul Scobell Says:

    This had me scratching my head as well, have just installed the trial version to evaluate and no Info Path forms in the library! When I get back to work I will add an upload event and see what we get! Thanks for this.

  2. loopzy Says:

    Thanks this was a good read

  3. Ronnie Says:

    I wonder why i get this error even when I used title field + processId as name of file:

    Server was unable to process request. —> File Upload failed - File already exists.

    I followed exact same steps and made sure that I selected template_1.xsn (my form’s root). Any suggestions?

  4. SpittingCAML Says:

    @Ronnie - check the version control on your form library, it may be that the forms have been created before, but are checked out (view checked out files).

    The error message you are getting is due to the file already existing in your library.

    It sounds like you’ve done it all correctly, but the metadata taxonomy is slightly out.

    good luck,

    SC

  5. Ronnie Says:

    SpittingCAML,
    I have checked the versioning on my form library and changed it to NO Versioning in settings, also I double checked and there are no related files checked out. If my form library is totally empty then my completed form WILL be saved but it’s the second time when I complete another workflow and at the end it throws the exception: File already exists. Any other suggestions?

  6. Thiago Says:

    Ronnie,

    make sure you use a unique identifier in the name of the form that you are saving off in the library (e.g. use the Process ID concatenated with some other identifier, plus the xml extension).

    You are likely getting that error because you have a form that is in process (though not yet saved to SP) and then a 2nd one is submitted with the same name.

    You can use the K2 portal process and delete the 1st process instance, to “clear your queue”. Then re-deploy your process with the updates for the unique naming conventions, and try again.

    HTH

    Thiago

Leave a Reply