Hi there,
In more and more sites I work on I have found the need to parameterize jobs to run the same job with different data. The use cases are typically around importing from multiple ERP systems or ERP companies, or importing into multiple languages. As an example, consider multiple ERP systems with a product import. This means we have different connections to the ERP but get the same data structure back. However, we need to put the products in the right PIM group. Today, we create a single job and make sure it works. We set a hardcoded PIM group. Then we duplicate the job, change the hardcoded PIM group and then set up two scheduled tasks to run both jobs. With parameterized jobs, I can do the following
1. Create my job as I normally do
2. Click "Job Parameters" on the ribbon and create a new variable called GroupID of type String
3. On the mapping for the Group ID column, I click Add Scripting and in the dropdown I choose Parameters. Then a second drop down appears that lets me select my GroupID parameter
After saving the job, I create a new scheduled task like I usually do and:
1. I select a job to run
2. Because the job has parameters, a list of available parameters shows up. I enter GROUP456 for the group ID and save
3. I repeat step 1 and 2 but enter GROUP678 for the ID
Now when the tasks run, the selected group ID is injected in the job and populates the Group column.
The biggest benefit of this is less maintenance: since I now have one job, updating it means I update it for both ERP connections, essentially moving all differences to a single location: the scheduled task.
Other use cases for this involve sending orders, where the anonymous customer ID (or other info) is different per company and currently requires duplicating the job.
V2 idea: also some of the other job settings are parameterizable, such as the source XML file or the OData end point.
Hope this makes sense.
Imar