Skip to main content
Slack의 Trailblazer Community가 이제 오픈 베타를 시작했습니다. 참여하고 실시간으로 소통하세요. Slack에서 함께하세요

Create and Configure Jobs

Learning Objectives

After completing this unit, you’ll be able to:

  • List three tasks you can perform with the Jobs module.
  • Create and assign resources to a job.
  • Add a job step to one or more flows.
  • Create a global parameter.

In this unit, you use Business Manager to create and configure B2C Commerce jobs. Business Manager Jobs gives you the tools to create and schedule jobs, set up email notifications for job failures, and use job resources to prevent conflicts.

Create the Job

Here’s how you create a job to import a catalog.

  1. In Business Manager, click App Launcher, and select Administration | Operations | Jobs.
  2. Click New Job (1).

Business Manager Jobs page.

  1. Enter apparel-catalog-data as the ID (1) and Catalog data for storefront as the description (2).
  2. Click Create (3).

Business Manager Jobs New Job page.

  1. Click the Schedule and History tab.
  2. Select Enabled to run the job on a schedule. If the job isn't enabled, you can still trigger it manually.
  3. Select Once to trigger the job to run once, or select Recurring Interval. For jobs that you want to run on a recurring interval, use the calendar icon to select a date in the past. If you don’t schedule a date in the past, you must wait for the date you specified for the job to run. You can also select a day of the week, a time, an interval, and a number of times the job runs.

Protect Resources with Locks

  1. You lock a resource to prevent another user or job from changing it while your job operates on it. For example, while you update your catalog, lock it to prevent other jobs or users from updating or changing the catalog, categories, or products. Here’s how you lock it.Click the Resources tab (1).
  2. Click Select (2).
  3. Select System Resource (3).
  4. Add the objects that the job changes or updates as resources, like order.
  5. Click Select (4).

Job Resource page.

Add the Job Step to a Flow

You want to add job steps.

  1. In a new job, click the Job Steps tab. The step shows on the Job Steps page as a gray rectangle (1). Job Steps tab with one workflow.
  2. To create a step in the flow, click Configure a step.
  3. In the Select and Configure step pane, select ImportCatalog. Remember that sandbox environments don’t run scheduled custom jobs.
  4. Specify the job step parameters. Each job step has its own unique parameters. Hover over a parameter name to get more information about the parameter.
  5. Here are the parameters for the ImportCatalog job step above.
    1. Enter a unique step ID.
    2. Add a description. The description shows up on both the workflow and job.
    3. Specify the working folder. The folder contains the catalog files the job imports. The folder location is relative to IMPEX/src. If you don’t define this value, B2C Commerce uses IMPEX/src as the working folder.
    4. Enter the FileNamePattern to be the name of the file the job imports. Use a regular expression (regex) to specify multiple files. If you don’t define this value, Salesforce B2C Commerce imports all files in the working folder.
    5. Specify NoFilesFoundHandling, for what happens if B2C Commerce doesn’t find any files to import.
    6. Specify ImportFailedHandling, for what happens if the import fails.
    7. Select the import mode:
      • Delete: Delete the object.
      • Merge: Create the object if it doesn’t exist, then do an update.
      • Replace: Re-create the object with the data provided.
      • Update: Update an existing object.
    1. Specify AfterImportFileHandling, for what happens to the files after import.
    2. Specify the ArchiveFolder. If it’s set to Archive or Archive zipped, this setting defines where B2C Commerce stores files relative to the IMPEX directory. If it’s not defined, B2C Commerce archives the files in IMPEX/archive.
    3. Select Always run on restart if you want B2C Commerce to restart the job if it fails. We recommend that you include this action on each run, even if B2C Commerce completes the job before the restart.
    4. Specify Error Handling, for how the system responds to job errors.
  1. For Scope, leave the value at its default of Organization. It’s a system requirement to run the ImportCatalog job step with a scope of Organization.

Add a New Flow

When you create a job, Business Manager configures one flow for you. You then add all your job steps to that flow. You also create up to 10 sibling flows, which Business Manager represents side by side on the Job Steps tab. You configure sibling flows to run sequentially or in parallel.

However, as you learned earlier, if there aren’t enough resources for parallel execution or if a step type fails to support parallel execution, B2C Commerce runs the sibling flows sequentially.

Here are the flow options on the Jobs tab.

  1. Add a sibling flow (1).
  2. Toggle between sequential and parallel processing of sibling flows (2).
  3. Add a new sequential flow (3).

Flow options on Job Steps tab.

Configure Troubleshooting Settings

You want to configure troubleshooting settings to help isolate problems. You take these steps.

  1. Click the Failure Handling tab and select a failure rule. B2C Commerce invokes the rule if a job step uses Error Handling On ERROR and specifies Error Handling Action as STOP.
  2. To receive a job status notification, click the Notification tab and add these settings.
    1. Select Enabled.
    2. Select which events you want to receive notifications about.
    3. Enter the required email information.
    4. Select Enabled under Long Runtime Detection and enter the runtime threshold.

Run a Job Manually

Sometimes you receive a request for an important or emergency job or you want to run a job manually when troubleshooting. Here’s what you do.

  1. Open Business Manager.
  2. Select Administration | Operations | Jobs.
  3. Select the job that you want to run.
  4. Click Run Now.
  5. Examine the history section at the bottom of the page to see if there are errors or problems with the job.
  6. You can also select Administration | Operations | Job History to monitor the status of jobs.

Apply Job Parameters Across Steps

You create a job parameter to use in different job steps. For example, you create a parameter for ReplicationProcessID and set it to the ID of a specific replication process. You use the parameter in different job steps. To use a different replication process, you change the value of the parameter, and B2C Commerce updates all the steps that include the parameter.

After you configure a job parameter, you reuse it only for step parameters defined in the same way as the original parameter.

Here are three examples.

  • You create a job parameter for a step parameter requiring a Boolean true/false value. You don’t use it for a step parameter requiring strings.
  • Two steps have a string parameter FileName with a pattern constraint *.xml. You define a job parameter to use in both steps.
  • One step has a string parameter FileName with a pattern constraint .xml, and another step has a string parameter FileName with a pattern constraint .txt. You define two job parameters, one for each step.

To set custom job steps with the same job parameter, the step parameters have identical type definitions in the steptypes.json file. In other words, all of the attributes of the parameter are identical.

In this example, you don’t use the same job parameter to set two custom step parameters because the @type attribute for MyParameter1 is "long" and the @type attribute for MyParameter2 is "double."

{
 "@name":"MyParameter1",
 "@type":"long",
 "@required":"false",
 "description":"An optional long parameter. The default value is 10 when not defined.",
 "default-value":"10"
},
 "@name":"MyParameter2",
 "@type":"double",
 "@required":"true",
 "@trim":"true",
 "description":"A required double parameter were the raw
  value is trimmed, value must be between -10 and +10.",
 "min-value":"-10",
 "max-value":"10"
},

Create a Job Parameter

  1. Create a job step or select an existing one.
  2. Click the field that you want to create a parameter for.
  3. Click Job Parameters.
  4. Click Add Job Parameter.
  5. Enter a unique name for the parameter.
  6. Enter the value for the parameter.
  7. Click Save.
  8. Click Assign.
  9. To use the parameter in another job step:
    1. Click the field that you want to use the parameter for.
    2. Click Job Parameters.
    3. Select the parameter to use.
    4. Click Assign.

Modify a Job Parameter

To modify a job parameter:

  1. Select Job Parameters on the Job Steps tab.
  2. Select the parameter that you want to change and enter the new value.
  3. Click Save.

Next Steps

In this unit, you learned to schedule, create, and configure jobs. Next, you learn to recover from job failures.

Resources

Salesforce 도움말에서 Trailhead 피드백을 공유하세요.

Trailhead에 관한 여러분의 의견에 귀 기울이겠습니다. 이제 Salesforce 도움말 사이트에서 언제든지 새로운 피드백 양식을 작성할 수 있습니다.

자세히 알아보기 의견 공유하기