sbrownhuntoilco
Nintex Newbie

Referencing data from another process?

I have a process that will be kicked off by any off several other processes.  I need to be able to easily grab data from the "parent" process to make use of it in the "child" process.  I will be storing the ID of the "parent" process in each "child" process.

 

My first thought was to add a Reference to the child process (we always build SmartObjects for all of our processes), because data in the parent process could continue to change after the child process is started and I need current values in the child process.  However, I have found that K2 only deploys a List method for process SmartObjects, and I can't seem to find a way to filter the SmartObject reference down to the appropriate process instance.

 

What is the proper way to handle this scenario?

Reply
9 Replies
MASWorkflow
Nintex Newbie

Re: Referencing data from another process?

Typically we create a SmartObject specific for a child process data with a link to tha parent process.  It depends on wether you are using a SmartBox SmartObject or SQL based one but make sure your child has primary key this will expose the Create, Load and Delete methods.  Rule of thumb is only store your look up ID's in your process data fields.  It's too tricky to get process data fields out of the workflow or to modify them is something should break or stop working. 

 

Typically the Process SmartObjects that k2 will generate have one method - Start Process.  You can also look at the System SmartObjects that contain Acitivity and process data if you have to use Process Data fields.  Again not the easiest route but possible.

 

Paul

0 Kudos
Reply
KennyC
Nintex Newbie

Re: Referencing data from another process?

If you have the Process Instance ID from the parent process you can use the List method of the Process Instance smart object under the Workflow Reports>Workflow General category.

 

The List method can accept the Process Instance ID as a input field so you can filter by that particular process instance.

 

 


process_instance_list_870.png
0 Kudos
Reply
sbrownhuntoilco
Nintex Newbie

Re: Referencing data from another process?

@MASWorkflow: Data I need access to is in another process, not SmartBox or SQL.

 

@KennyC: Yeah, I know I can filter.  Trouble is I will be using data from the parent process in lots of places in the child process, so I was hoping that I could do the filter once in one place (e.g. a Reference) and use the reference in all of those places.  Fewer chances to fat finger something, ya know?

0 Kudos
Reply
KennyC
Nintex Newbie

Re: Referencing data from another process?

Hi sbrownhuntoilco,

 

I think I understand you requirement better. You can achieve this by following these steps:

 

  1. Add a reference to the smart object method from the References node in the Object Browser.
  2. You can specify the input mapping / filter here.
  3.  In one of the events (e.g. Data event), you can execute the referenced smart object method and copy the return value to a data field for example.

Hope this makes sense.


1__so_mapping_878.png
2__input_mapping_880.png
3__event_reference_882.png
0 Kudos
Reply
sbrownhuntoilco
Nintex Newbie

Re: Referencing data from another process?


@KennyC wrote:
You can specify the input mapping / filter here.

That's what I was hoping for, but I don't get any fields to map on that screen (see attached).  I don't see them in the SmartObject Tester app either.

 

Is there some magic sauce I have to add to the SmartObject to enable this?


inputmapping_884.png
0 Kudos
Reply
KennyC
Nintex Newbie

Re: Referencing data from another process?

Hi sbrownhuntoilco,

 

What smart object method are you calling? It could be the fact that the smart object method does require or accept any input properties.

0 Kudos
Reply
sbrownhuntoilco
Nintex Newbie

Re: Referencing data from another process?

I'm calling the List method on the SmartObject generated by K2 for my process.

0 Kudos
Reply
KennyC
Nintex Newbie

Re: Referencing data from another process?

Oh I see.

 

Yes I have just tried with one of the smart objects for a workflow. There is only one List Process Instances method that does not allow you to specify any input properties as you stated in the original post.

 

I am not sure you can do this with the workflow generated smart objects under the Workflow Solutions category. Would it be possible to use the generic Process Instance SO under Workflow General category?

 

If you need access to the process data fields the Process Data SO in the same category may give you what you need.

0 Kudos
Reply
sbrownhuntoilco
Nintex Newbie

Re: Referencing data from another process?

Yeah, I might have to use the Process Data SmartObject field by field.

 

Ugly, but it might do the trick.

0 Kudos
Reply