Inbound population on sub workflows

mark_stiebel

03-12-2019

I'm attempting to create a handful of re-usable workflow blocks by using sub-workflow, but have come across a stumbling block when trying to pass a targeting dimension to the sub-workflow.

Main workflow:

Eligible Recipients query finds list of potential targets, then calls "Suppression Filter" workflow.

1860785_pastedImage_0.png

Suppression Sub-workflow:

Intention is for the Suppression Check to filter the inbound population based on re-usable suppression rules, save the excluded targets (in this test case, just to a text file) and then return to the main workflow with a reduced recipient list.

1861178_pastedImage_3.png

This is all very good in theory, but how do I go about making the inbound population schema available to the sub-workflow?

The documentation at Sub-workflow alludes to being able to pass a table and schema into the sub-workflow, but doesn't elaborate on how to refer to an input table and schema within the sub workflow. Is this even possible?

Accepted Solutions (1)

Accepted Solutions (1)

kapilKochar

MVP

04-12-2019

Hi Mark,

In first jump activity , go to advanced tab and write below code

logInfo("Test previous content " + activity)

you will get some XML as an output, now what you need to do is to traverse this XML and build a logic around this . Like what all information you need from main workflow to Subworkflow.

Thanks,

Kapil

Answers (7)

Answers (7)

Jyoti_Y

MVP

05-12-2019

Hi Mark,

Your subworkflow will have all the data passed through your actual workflow.

For testing purpose, whether you have designed subworkflow correctly or not: You can place one query instead of first jump, passing data which you are passing to your subworkflow.

Once it is tested, you can replace your query with jump and make it as a subworkflow.

Thanks.

kapilKochar

MVP

05-12-2019

I believe you do not have to do this additional steps. As i have done the same using above method which i mentioned in my previous comment and that is working fine. 

kapilKochar

MVP

05-12-2019

Yes, that's what i said in above comment. Once you have the object from your previous workflow now you can play with that object and parse this using XML.

e.g activity.extension.schema will give you all the node values !!

mark_stiebel

04-12-2019

I think I've found a resolution, but here's the process that I went through, and my resolution - either for future reference for others in the same position, or for someone to correct me with a better way to achieve this.

In the sub-workflow, the transition from the incoming jump point, does not have a table or a schema. This sort of makes sense, because the Jump in itself doesn't have a schema defined, and the sub-workflow can't know where it's going to be called from.

1861273_pastedImage_0.png

On the "Suppression Check" split, if I try to use the Temporary schema from the Jump, I get the following error, which again is not unexpected, because the Jump doesn't have a defined schema.

1861276_pastedImage_3.png

But I can use the nms recipient schema, and build my filtering query successfully:

1861403_pastedImage_4.png

Even though the Suppression split is using Recipients for the Target and Filtering dimensions, the output transition still shows no schema:

1861404_pastedImage_5.png

And of course this then means that there is no schema defined for the Data extraction step:

1861274_pastedImage_1.png

So what I've done is create a Query on the recipient table as well as an enrichment to get the linked attributes that I'm after. This results in me being presented with a list of available fields in my data extraction format:

1861405_pastedImage_8.png

And finally, put the workflow back to how it should be, and disable the Query:

1861406_pastedImage_9.png

_Manoj_Kumar

MVP

04-12-2019

Hello Mark,

Whatever you are fetching from the Eligible Recipient will be available for the Sub-workflow to use. Did you try running this workflow ?

It should work properly.

Thanks,

Manoj