InfoPath Integration

  • 29 October 2008
  • 3 replies
  • 0 views

Badge +1

I'm trying to build a conditional approval workflow such that based on a checkbox on the InfoPath forms, it is determined whether or not to do secondary approval is required.  I roughly understand how the Line Rule works but I'm not sure how to get the value of the checkbox to use it as a variable for the Line Rule.  Do I need to bind all the InfoPath input to a Smart Object and then somehow get the value that way? - that's what I'm thinking but I haven't quite figured out that either.

 I can already do this in WF but I've only been working w/ K2 Blackpearl for about a week. 


3 replies

Badge +4

That is one way,

The other way which you could do is read the XML of the InfoPath form in custom server code event, find out if that box is checked, and set that value to a process level data field.  Then create your line rules based on that data field.

Good luck!

Badge +6
It's actually much easier than that.  You can read from InfoPath XML directly in the line rule.  No need to use a server code event, you just need to know the data type and output of the field.  When you create the check box in your form you can specify the data type (Whole Number, Text, Decimal, etc.) and you can specify the value when checked and unchecked.  For example, if your check box had a data type of Whole number then you could set checked value is 1 and unchecked value is 0.  When you create your line rule "First Variable" will be your InfoPath XML field.  To select this field directly you will want to select the Process/Activity Data tab, expand XML Fields, expand option that matches your process name (should have 2 options if working with 1 process, Activities and process), then keep expanding until you get to your check box field.  Compairson operator will be "equals" and Second Variable will be set depending on which direction you want it to go (either 1 or 0).  When the line rule executes it will read the value of the check box from the form and you didn't have to write any code!  Hope this helps
Badge +4

Another option would be to define the Outcomes to factor in the value of the checkbox.  For example, if you have an Action of "Submit", but based on that in combination with the checkbox you want the workflow to conditionally proceed to a secondary activity, you could create 2 outcomes.  One outcome would also include a rule that checks if the checkbox is 0 (or false, depending on that values stored in the checkbox) and the other outcome would also include a rule that checks if the checkbox is 1 (or true).  Then you can have the wizard generates the line rules for you and then you just hook them up.

Reply