Duplicate Activity Based on InfoPath Data


Badge +9

Here is an interesting problem I can't figure out a solution to... in our base InfoPath request form, the user is presented with a couple of rows of data that they can order services off of.  The services are the same, it is the row data that is different.  For each row that the user orders a service for, an activity needs to be created and assigned to the service center for processing.  For example:


The user selects to get service for Record A and Record B, and submits the request.  The workflow accepts the request, and creates a service activity for Record A and Record B, assigning them both to a coordinator at the service center.


So it is almost as if I want a for-each loop on all of the records check off by the user for service in their InfoPath form and kick off a process for each of them (the same process, different data).  Is this even possible?


 


6 replies

Badge +6

Hi Tim,


 Yes that is an interesting one, but I don't think a very uncommon requirement to do things based on line items. One possible solution for this would be to start one normal workflow for the form and then the first (and maybe only) activity in this process has an IPC event which starts the real workflow you want for each selected record. Then you set the destination rule of that activity to the xml repeating node that contains all your line items, thereby ensuring that one IPC event will be started for every line item you have.


You might have to do some data manipulation to pass in the correct data fields into each IPC process, but in principle this should be do-able..


Cheers,

Badge +9
Cool, I wasn't aware that I could set my destination users to an xml node and get this functionality.  It is working, but I'm not sure how to get to that data that is driving the activity (the specific node in the xml that belongs to this instance).  Can you explain how I would get to that?  I've tried activityinstancedestination.user/instancedata/xmlfields/datafields/etc. with no luck.
Badge +9

Ug, I guess it wasn't working as well as I thought... it will call my code in the activity for each line item, but the IPC call itself fails with a vague error in the console:


Logging Framework error, MsgID=24417 <Message Not Found>
Failed to start IPC


Not sure what that error could indicate, I simply call the child process without any special rules or parameters and I still get this error.  Anybody have any ideas? 


 

Badge +9
All right, I'm a moron.. I forgot to give the user start rights on the child process - though a little more informational error message would've been nice.
Badge +6

Yes, passing the data through will be the tricky bit. It will not be done automatically so you'll maybe have to copy each node into an activity instance (maybe through code). Then in the IPC data mapping assign those fields to be passed into your child IPC event.


Glad to hear you for over the other error, it is weird that it did not give a more descriptive "permissions" error message, because that is how it was before.


Cheers,

Badge +9
Getting to my data is proving to be a challenge... I have multiple fields in my line items, and it simply concatenates them all into one big non-delimited string!  I'm not sure how I will turn that back into my field data.  I am using the 'plan per slot' option, using my list xml to define the slots.  Then I can use the ActivityInstanceDestination.InstanceData to get to that string of my field data.

Reply