Using Workflow Parameters and Variables to Write to a Dynamic Target File

Using Workflow Parameters and Variables to Write to a Dynamic Target File

Scenario

Scenario

You have a single mapping that multiple departments need to run. For each mapping run, you need the mapping to write to a flat file named with the department name and a time stamp with the current date. You do not want to create a unique mapping for each department because of the overhead of maintaining multiple mappings.

Solution

Create a workflow to run the mapping. Design the workflow to use parameters and variables to dynamically determine the file name at run time.
Design the flat file data object to use a parameter for the output file name. Create a workflow and add the mapping to the workflow as a Mapping task. Create a workflow parameter to represent the department name. When a user runs the workflow from the command line, the user specifies a parameter file that includes the department name. Create a workflow variable to represent the dynamic target file name. Use an Assignment task to assign the value of the department name parameter and the current date to the workflow variable. In the Mapping task, override the flat file data object parameter with the workflow variable that captures the department name and current date.
Deploy the workflow, and then use the infacmd wfs ListWorkflowParams command to create a parameter file that lists the default value of the department name workflow parameter. Edit the parameter file to replace the default parameter value with the appropriate department name. Then, use the infacmd wfs StartWorkflow command to run the workflow with the edited parameter file.

0 COMMENTS

We’d like to hear from you!