Repo for all contributed Snowfakery recipes, maintained by Data Gen Toolkit team.
These instructions explain how to create sample data using for Program Management Module objects using the sample files in the snowfakery_samples directory.
Install Python. Python is usually pre-installed on MacOS. See CumulusCI installation instructions for installing on Windows
Install pipx
pip3 install pipx
# add pipx to your path and restart your terminal if necessary
Install snowfakery
pipx install snowfakery
# test the installation
snowfakery --version
Generate sample data locally. Run Snowfakery with the pmm_1_program-service.recipe.yml
file to generate output on your local machine.
snowfakery snowfakery_samples/PMM/pmm_1_program-service.recipe.yml
To load snowfakery data into a Salesforce org, you also need to install the Salesforce CLI and CumulusCI and connect to a Salesforce Dev Hub org. Follow this Trailhead module to get set up.
Navigate to the root folder of the project that is organized wtih source format.
Initialize CumulusCI configuration in the project
cci project init
Make sure you enter sfdx
for the source format and indicate that you are extending PMM as part of the setup wizard.
Add a snowfakery recipe yml file to the datasets
folder directory
cci flow run dev_org --org dev
# example below assumes the snowfakery recipe is located datasets/simple.yml
cci task run generate_and_load_from_yaml -o generator_yaml datasets/simple.yml --org dev
# A list of objects to delete records from in order of deletion. If passed via command line, use a comma separated string
cci task run delete_data -o objects Opportunity,Contact,Account --org <cci org name>
cumulusci.yml
To define a new task for your project, add the task name under the tasks section of your cumulusci.yml file. Continue reading CulumusCI Documentation
tasks:
generate_pmm_data:
description: Deploy PMM Data
group: SFDO Mock Data
class_path:
cumulusci.tasks.bulkdata.generate_and_load_data_from_yaml.GenerateAndLoadDataFromYaml
options:
generator_yaml: snowfakery_samples/PMM/pmm_1_program-service.recipe.yml
num_records: 100
num_records_tablename: pmdm__Program__c
# cci task run <task name> --org dev
cci task run generate_pmm_data --org dev
cumulusci.yml
flows:
generate_sfdo_data:
group: SFDO Mock Data
description: generate npsp data.
steps:
1:
task: <name>
2:
task: generate_pmm_data
cci flow run <flow name> --org <org>
cci flow run generate_sfdo_data --org dev