CustomActivity node with a FlowRunner activity - How to pass information to the child flow?

 6 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Jose Gonzo
Basic Member Send Private Message
Posts: 20
Basic Member
I am developing a flow that uses a CustomActivity node with a FlowRunner activity to call another flow. The Action on the Custom Activity is runFlow.

The issue I am having is that I haven't found a way to pass information from the Main flow to the Child flow. Any suggestions on how to do this?

I've tried to use the flowInputData property on the Input section of the CustomActivity on the main flow, but don't know how to read that property on the Child flow.

Thanks for all your help. Have a great day.
BarbR
New Member Send Private Message
Posts: 0
New Member
You can do this with the WorkObject node, and triggering a Service. The service should have variables defined. On the node General tab you would select the service you want to trigger, and you'd use the node's Variables tab to variables and values.
BarbR
New Member Send Private Message
Posts: 0
New Member
FYI - If you haven't defined a service, service variables, service criteria, and service process before - come back.
Jose Gonzo
Basic Member Send Private Message
Posts: 20
Basic Member
Thank you for your reply. How do you code a 'Service'? Can it be coded in .Net? 

Thanks for all your help. Have a great day.
BarbR
New Member Send Private Message
Posts: 0
New Member
This is the beauty of Lawson Process Flow services - no coding at all!
Open the ProcessFlow Administration Tool (your server/bpm/menu.do)
1. Services - Service Definition. This defines the service your parent flow is going to trigger. Enter a Service name (ChildSvc), product ERP-ERP, Status 1-Enabled, a Description, ADD.
2. Services - Service Variables Definition. This defines the variables you are wanting to pass to your service for use by the child flow. Select your service name and product ERP-ERP and inquire. For each variable you want to pass: ADD, Variable name, Key FIeld N, Size and type whatever you need it to be. When all of your variables are defined, click the Process button.
3. Services - Criteria Level Definition. All services have to have a default criteria definition. Select your service name and product ERP-ERP and inquire, select add on the first line and nothing else, then click the Process button.
4. Services - Process Definition. This defines the process flow that your service will execute. Select your Service name and product ERP-ERP and inquire. Select Add, select the process flow name of your child flow (e.g. Childflow), select event type EVT_PFLOW, and click the Process button.
You're done. You can now trigger the service ChildSvc which will execute flow Childflow with the service variables passed to it. Of course, don't forget to use the same variable names in your Childflow that you defined in your ChildSvc.



Jose Gonzo
Basic Member Send Private Message
Posts: 20
Basic Member
Thanks a lot BarbR. I will try this today.
Do you know of a good Tutorial on how to use WorkObject node to trigger a Service?
Thanks a lot for all your help. Have a great day.
BarbR
New Member Send Private Message
Posts: 0
New Member
I wish. No, only the Process Flow Developer Guide, which has some additional info, but not much more than what you can already see in the node itself. I find trial and error to work best. My recommendation:
First set up your service without any variables at all and test triggering the service from your parent flow to be sure your child flow is executed.
Second add a simple variable in your parent flow, child flow, and Service Variable definition (exact same name!). Assign a value to the variable in your parent flow, update the WorkObject trigger to select all variables and see if the value passes to your triggered child flow.
If that works, you're good to go.