How to pass additional parameters to SpawnWorkflow activity

How to pass additional parameters to SpawnWorkflow activity

book

Article ID: KB0088161

calendar_today

Updated On:

Products Versions
TIBCO Collaborative Information Manager -
Not Applicable -

Description

Resolution:
How to pass additional parameters to SpawnWorkflow activity

Environment:

TIBCO Product name and version: TIBCO Collaborative Information Manager 7.2.1
Operating System(s): All Operating Systems

Symptoms:

None.

Cause:

None.

Resolution:

Here are the steps to be followed:

Pass the parameter as an "in" parameter to the SpawnWorkflow activity. In the example below, an "in" parameter called OutputFormat is passed with constant value "MineOutputFormat". Snippet of the SpawnWorkflow activity:

&ltActivity Name="SpawnWorkflow">
        &ltAction&gtSpawnWorkflow</Action>
        &ltDescription lang="en"&gtSpawn individual WorkFlow for each record bundle</Description>
        &ltExecution&gtASYNCHR</Execution>
        &ltParameter direction="in" type="string" eval="constant" name="eventState"&gtSPAWNWORKFLOW</Parameter>
        &ltParameter direction="in" name="InDocument" type="document" eval="variable"&gtinDoc</Parameter>
        &ltParameter direction="in" name="InRecordList" type="recordlist" eval="variable"&gtworkRecordList</Parameter>
        &ltParameter direction="in" name="ProcessID" type="string" eval="constant"&gtstandard/workflow/wfin26catsourceimportv2</Parameter>
        &ltParameter direction="in" name="DocumentTemplate" type="string" eval="constant"&gtstandard/template/tm26catimportv1.xml</Parameter>
        &ltParameter direction="in" eval="constant" name="Form" type="string"&gtstandard/forms/fm26importtemplatev1.xml</Parameter>
        <!-- &ltParameter direction="in" name="OutputFormat" type="string" eval="constant"&gtMineOutputFormat</Parameter> -->
        &ltParameter direction="in" name="DefaultDomain" type="string" eval="constant"&gtMartQuestNet</Parameter>
        &ltParameter direction="in" name="SenderCredential" eval="xpath" type="long" source="/Message/Header/MessageHeader[@origin='Receiver']/Member/PartyID/DBID/text()"&gtinDoc</Parameter>
        &ltParameter direction="in" name="ChannelCredential" eval="xpath" type="long" source="/Message/Header/MessageHeader[@origin='Receiver']/Member/PartyID/DBID/text()"&gtinDoc</Parameter>
        &ltParameter direction="in" name="TradingPartnerCredential" eval="xpath" type="long" source="/Message/Header/MessageHeader[@origin='Receiver']/Member/PartyID/DBID/text()"&gtinDoc</Parameter>
        &ltParameter direction="in" name="MasterCatalog" eval="xpath" type="long" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/RevisionID/DBID/text()"&gtinDoc</Parameter>
        &ltParameter direction="in" name="OutputFormat" eval="xpath" type="long" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/RevisionID/DBID/text()"&gtinDoc</Parameter>
</Activity>

If you notice, an input parameter called OutputFormat is passed to the SpawnWorkflow activity. In the form fm26importtemplatev1, have the following to set the Value under OutputFormat based on the value set as in parameter in the SpawnWorkflow activity.

&ltField>
        &ltID&gtOutputFormat</ID>
&ltInputFrom>/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/Extension[@name='OutputFormat']/Value/text()</InputFrom>
        &ltOutputTo>(//Form/Field/ID[text()='OutputFormat'])/following-sibling::Value</OutputTo>
        &ltValue></Value>
</Field>

If you open the document passed to the spawned workflow, the OutputFormat element will have a Value set under it.

Attachments:
wfin26catsourcev4.xml
fm26importtemplatev1.xml

None

References:

None

Issue/Introduction

How to pass additional parameters to SpawnWorkflow activity

Attachments

How to pass additional parameters to SpawnWorkflow activity get_app
How to pass additional parameters to SpawnWorkflow activity get_app