You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+87-2Lines changed: 87 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,12 +161,14 @@ The supported types are:
161
161
-`enum`: A string from a predefined set of values with the optional human-readable names for each value.
162
162
-`date`,
163
163
-`timestamp`,
164
-
-`struct`.
164
+
-`struct`
165
+
166
+
-`permission`: A special strucuture associating a reference to an user-like record type (the field `member_id`) with an enum value that can be interpreted as the role or permission level associated with that user. This is useful in a few cases when mapping fields with the same type in devrev.
165
167
166
168
If the external system supports custom fields, the set of custom fields in each record type you wish to extract must be
167
169
declared too.
168
170
169
-
Enum fields' set of possible values can often be customizable. A good practice is to retrieve the set of possible values
171
+
Enum fields set of possible values can often be customizable. A good practice is to retrieve the set of possible values
170
172
for all enum fields from the external system's APIs in each sync run.
171
173
172
174
`ID` (primary key) of the record, `created_date`, and `modified_date` must not be declared.
@@ -291,6 +293,72 @@ If the field is array in the extracted data, it is still typed with the one of t
291
293
}
292
294
```
293
295
296
+
8. Consider state transitions
297
+
298
+
If an external record type has some concept of states, between which only certain transitions are possible, (eg to move to the 'resolved' status, an issue first has to be 'in_testing' and similar business rules), you can declare these in the metadata too.
299
+
300
+
This will allow us to create a matching 'stage diagram' (a collection of stages and their permitted transitions) in DevRev, which will usually allow a much simpler import and a closer preservation of the external data than needing to map to DevRev's builtin (stock) stages.
301
+
302
+
This is especially important if two-way sync will eventually be needed, as setting the transitions up correctly ensures that the transitions the record undergo in DevRev will be able to be replicated in the external system.
303
+
304
+
To declare this in the metadata, ensure the status is represented in the extracted data as an enum field, and then declare the allowed transitions (which you might have to retrieve from an API at runtime, if they are also customized).
The first function of the local UI is to assemble a 'blueprint' for concrete import running in the test-org, allowing the mapping to be tested out and evaluated.
448
+
449
+
## Use the local UI to create an initial domain mappings
450
+
451
+
The final artifact of the recipe creation process is the initial_domain_mappings.json, which has to embedded in the extractor.
452
+
453
+
This mapping, unlike the recipe blueprint of a concrete import, can contain multiple options for each external record type from which the end-user might choose (for example allow 'task' from an external system to map either to issue or ticket in devrev), and it can contain also mappings that apply to a record type category. When the user runs a new import, and the extractor reports in its metadata record types belonging to this category, that are not directly mapped in the initial domain mappings, the recipe manager will apply the per-category default to them.
454
+
455
+
After the blueprint of the test import was completed, the 'install in this org' button takes you to the initial domain mapping creation screen, where you can 'merge' the blueprint to the existing initial mappings of the org.
456
+
457
+
By repeating this process (run a new import, create a different configuration, merge to the initial mappings), you can create an initial mapping that contains multiple options for the user to choose from.
458
+
459
+
Finally the Export button allows you to retrieve the initial_domain_mapping.json.
460
+
461
+
## Tip: use local metadata in the local UI
462
+
378
463
You can also provide a local metadata file to the command using the '-m' flag for example: `chef-cli manage --end dev -m metadata.json`, this enables to use:
379
464
380
465
- raw jq transformations using an external field as input. (This is an experimental feature)
0 commit comments