Your First Synchronisation¶
In about 30 minutes, you take 25 people from an HR system's file, bring them into JIM, and have JIM write them out to a staff directory. By the end, JIM holds a Metaverse Object for each person, and a second file, written by JIM, lists all 25.
Both systems are files, read and written by the JIM File Connector, so you need nothing but JIM itself: this works on an evaluation installation with no network access. Every step is shown in the portal and in PowerShell; follow either, or switch between them.
Before you begin¶
- JIM is installed and running, and you can sign in to the portal as an administrator. Quick Start covers installing it.
-
For the PowerShell steps, the JIM PowerShell module is installed and connected to your JIM, as PowerShell Module describes:
-
You can run commands on the server JIM runs on, to copy the two sample files into JIM.
- You have downloaded the two sample files: hr-people.csv, the HR system's 25 people, and staff-directory.csv, the staff directory JIM writes to, which holds only its column headings.
Step 1: Put the sample files where JIM can read them¶
The File Connector reads and writes files under /connector-files, a folder in JIM's own storage. From the folder you downloaded the files to, copy them into a tutorial folder there:
Step 2: Connect JIM to the HR system¶
A Connected System is one system JIM exchanges data with. Create one for the HR file, say where the file is, and choose which of its columns JIM manages. Each person is identified by their employeeId, which becomes the External ID.
- Select Admin, then Connected Systems, then Create Connected System.
- Choose
JIM File Connectoras the Connector, enterHR Systemas the Name, and select Create Connected System. When JIM asks for a reason for the change, select Create; a reason is optional. - On the Settings tab, select the folder icon at the end of File Path, open the
tutorialfolder, selecthr-people.csv, and choose Select. - Enter
employeeas the Object Type, leave Mode at Import Only, and select Save Settings. If JIM asks you to confirm the change, select Save changes; then select Save. - On the Schema tab, select Retrieve Schema. JIM reads the file's column headings and finds one Object Type,
employee, which it selects for you. - Select the
employeetab, and turn on the switch in the Selected column for all seven attributes. - Choose
employeeIdas the External ID Attribute, then select Save Changes, and Save changes if JIM asks you to confirm.
$fileConnector = Get-JIMConnectorDefinition | Where-Object Name -eq 'JIM File Connector'
$setting = @{}
(Get-JIMConnectorDefinition -Id $fileConnector.Id).Settings | ForEach-Object { $setting[$_.Name] = $_.Id }
$hrSystem = New-JIMConnectedSystem -Name 'HR System' -ConnectorDefinitionId $fileConnector.Id -PassThru
Set-JIMConnectedSystem -Id $hrSystem.Id -SettingValues @{
$setting['File Path'] = @{ stringValue = '/connector-files/tutorial/hr-people.csv' }
$setting['Object Type'] = @{ stringValue = 'employee' }
} | Out-Null
Import-JIMConnectedSystemSchema -Id $hrSystem.Id | Out-Null
$hrEmployee = Get-JIMConnectedSystem -Id $hrSystem.Id -ObjectTypes | Where-Object Name -eq 'employee'
Set-JIMConnectedSystemObjectType -ConnectedSystemId $hrSystem.Id -ObjectTypeId $hrEmployee.Id -Selected $true | Out-Null
$selection = @{}
$hrEmployee.Attributes | ForEach-Object { $selection[$_.Id] = @{ selected = $true; isExternalId = ($_.Name -eq 'employeeId') } }
Set-JIMConnectedSystemAttribute -ConnectedSystemId $hrSystem.Id -ObjectTypeId $hrEmployee.Id -AttributeUpdates $selection | Out-Null
Step 3: Connect JIM to the staff directory¶
Create a second Connected System for the staff directory file. JIM only writes to this one, so its Mode is Export Only: JIM writes each change to the file and treats it as confirmed, without reading the file back.
- Select Admin, then Connected Systems, then Create Connected System.
- Choose
JIM File Connectoras the Connector, enterStaff Directoryas the Name, and select Create Connected System, then Create. - On the Settings tab, choose Export Only as the Mode first. Then select the folder icon at the end of File Path, open the
tutorialfolder, selectstaff-directory.csv, and choose Select. - Enter
employeeas the Object Type, and select Save Settings, confirming and saving as before. - On the Schema tab, select Retrieve Schema, then the
employeetab, and turn on the switch in the Selected column for all five attributes. - Choose
employeeIdas the External ID Attribute, and select Save Changes.
$directory = New-JIMConnectedSystem -Name 'Staff Directory' -ConnectorDefinitionId $fileConnector.Id -PassThru
Set-JIMConnectedSystem -Id $directory.Id -SettingValues @{
$setting['File Path'] = @{ stringValue = '/connector-files/tutorial/staff-directory.csv' }
$setting['Object Type'] = @{ stringValue = 'employee' }
$setting['Mode'] = @{ stringValue = 'Export Only' }
} | Out-Null
Import-JIMConnectedSystemSchema -Id $directory.Id | Out-Null
$directoryEmployee = Get-JIMConnectedSystem -Id $directory.Id -ObjectTypes | Where-Object Name -eq 'employee'
Set-JIMConnectedSystemObjectType -ConnectedSystemId $directory.Id -ObjectTypeId $directoryEmployee.Id -Selected $true | Out-Null
$selection = @{}
$directoryEmployee.Attributes | ForEach-Object { $selection[$_.Id] = @{ selected = $true; isExternalId = ($_.Name -eq 'employeeId') } }
Set-JIMConnectedSystemAttribute -ConnectedSystemId $directory.Id -ObjectTypeId $directoryEmployee.Id -AttributeUpdates $selection | Out-Null
Step 4: Bring the HR system's people into the Metaverse¶
First, tell JIM how to recognise a person it already holds. An Object Matching Rule on the HR System says that an HR record and a Metaverse Object are the same person when the record's employeeId equals the Metaverse Object's Employee ID. On this first run nobody matches, but run the steps again and JIM finds the people it already has, rather than creating them twice.
Then create a Synchronisation Rule, which says how data flows between a Connected System and the Metaverse, JIM's own record of each identity. This one is an import rule: it creates a Metaverse Object of type User for each person JIM does not already hold (projection), and copies seven of their attributes across (Attribute Flow).
| HR file column | Metaverse attribute |
|---|---|
employeeId |
Employee ID |
firstName |
First Name |
lastName |
Last Name |
displayName |
Display Name |
email |
|
department |
Department |
jobTitle |
Job Title |
- Open the
HR SystemConnected System (Admin, then Connected Systems), and select its Matching tab. Under Add Matching Rule, chooseemployeeIdas the Connected System Attribute,Employee IDas the Metaverse Attribute and User as the Metaverse Object Type, then select Add Matching Rule. - Select Admin, then Synchronisation Rules, then Create Synchronisation Rule.
- Enter
HR System: import peopleas the Name, and chooseHR Systemas the Connected System, Import as the Direction, User as the Metaverse Object Type andemployeeas the Connected System Object Type. - Turn on Project Users to the Metaverse?.
- On the Attribute Flow tab, select Add Attribute Flow. Choose Attribute as the Source Type,
employeeIdas the Connected System Attribute andEmployee IDas the Metaverse Attribute, then select Add Attribute Flow. - Add an Attribute Flow in the same way for each of the table's other six rows.
- Select Create Synchronisation Rule, then Create.
$mvUser = Get-JIMMetaverseObjectType | Where-Object Name -eq 'User'
$mvAttribute = @{}; Get-JIMMetaverseAttribute | ForEach-Object { $mvAttribute[$_.Name] = $_.Id }
$hrAttribute = @{}; $hrEmployee.Attributes | ForEach-Object { $hrAttribute[$_.Name] = $_.Id }
New-JIMMatchingRule -ConnectedSystemId $hrSystem.Id -ObjectTypeId $hrEmployee.Id -MetaverseObjectTypeId $mvUser.Id `
-SourceAttributeId $hrAttribute['employeeId'] -TargetMetaverseAttributeId $mvAttribute['Employee ID'] | Out-Null
$importRule = New-JIMSyncRule -Name 'HR System: import people' -ConnectedSystemId $hrSystem.Id `
-ConnectedSystemObjectTypeId $hrEmployee.Id -MetaverseObjectTypeId $mvUser.Id -Direction Import -ProjectToMetaverse -PassThru
$flows = [ordered]@{
employeeId = 'Employee ID'; firstName = 'First Name'; lastName = 'Last Name'; displayName = 'Display Name'
email = 'Email'; department = 'Department'; jobTitle = 'Job Title'
}
foreach ($column in $flows.Keys) {
New-JIMSyncRuleMapping -SyncRuleId $importRule.Id -SourceConnectedSystemAttributeId $hrAttribute[$column] `
-TargetMetaverseAttributeId $mvAttribute[$flows[$column]] | Out-Null
}
Step 5: Send the people to the staff directory¶
The second Synchronisation Rule is an export rule: for each User in the Metaverse, it creates an entry in the staff directory (provisioning), and writes five of the person's attributes to it.
It has a scope, too. Your JIM most likely holds one User already: you, the administrator who signed in. You have no Employee ID, and the staff directory is for the HR system's people, whose Employee IDs all start with HR-, so the rule takes only those.
| Metaverse attribute | Staff directory column |
|---|---|
| Employee ID | employeeId |
| Display Name | displayName |
email |
|
| Department | department |
| Job Title | jobTitle |
- Select Admin, then Synchronisation Rules, then Create Synchronisation Rule.
- Enter
Staff Directory: provision peopleas the Name, and chooseStaff Directoryas the Connected System, Export as the Direction, User as the Metaverse Object Type andemployeeas the Connected System Object Type. - Turn on Provision employees to the Connected System?.
- On the Attribute Flow tab, add an Attribute Flow for each row of the table, as in Step 4: the Metaverse Attribute is the source, and the Connected System Attribute the target.
- On the Scope tab, choose Filtered, then Add Criteria Group. Choose All as the group type, and select Add Group.
- Select Add Criteria. Choose
Employee IDas the Metaverse Attribute and starts with as the Comparison Type, enterHR-as the Text Value, and select Add Criteria. - Select Create Synchronisation Rule, then Create.
$directoryAttribute = @{}; $directoryEmployee.Attributes | ForEach-Object { $directoryAttribute[$_.Name] = $_.Id }
$exportRule = New-JIMSyncRule -Name 'Staff Directory: provision people' -ConnectedSystemId $directory.Id `
-ConnectedSystemObjectTypeId $directoryEmployee.Id -MetaverseObjectTypeId $mvUser.Id -Direction Export -ProvisionToConnectedSystem -PassThru
$flows = [ordered]@{
'Employee ID' = 'employeeId'; 'Display Name' = 'displayName'; 'Email' = 'email'; 'Department' = 'department'; 'Job Title' = 'jobTitle'
}
foreach ($attribute in $flows.Keys) {
New-JIMSyncRuleMapping -SyncRuleId $exportRule.Id -SourceMetaverseAttributeId $mvAttribute[$attribute] `
-TargetConnectedSystemAttributeId $directoryAttribute[$flows[$attribute]] | Out-Null
}
$group = New-JIMScopingCriteriaGroup -SyncRuleId $exportRule.Id -Type All -PassThru
New-JIMScopingCriterion -SyncRuleId $exportRule.Id -GroupId $group.Id -MetaverseAttributeName 'Employee ID' `
-ComparisonType StartsWith -StringValue 'HR-' | Out-Null
Step 6: Create the Run Profiles¶
A Run Profile is one operation JIM runs against a Connected System. You need three: a Full Import to read the HR file, a Full Synchronisation to apply the rules, and an Export to write the staff directory. Each one reads or writes the file its Connected System names: leave the Full Import's File Path empty, and the other two have none.
- Open the
HR SystemConnected System (Admin, then Connected Systems), and select its Run Profiles tab. - Select Create Run Profile. Enter
Full Importas the Name, choose Full Import as the Run Type, and select Create Run Profile. - Select Create Run Profile again. Enter
Full Synchronisationas the Name, choose Full Synchronisation as the Run Type, and select Create Run Profile. - Open the
Staff DirectoryConnected System's Run Profiles tab, and create a Run Profile namedExportwith Export as its Run Type.
New-JIMRunProfile -ConnectedSystemName 'HR System' -Name 'Full Import' -RunType FullImport | Out-Null
New-JIMRunProfile -ConnectedSystemName 'HR System' -Name 'Full Synchronisation' -RunType FullSynchronisation | Out-Null
New-JIMRunProfile -ConnectedSystemName 'Staff Directory' -Name 'Export' -RunType Export | Out-Null
Step 7: Import the HR file¶
Run the Full Import. JIM reads the file and holds each row as a Connected System Object in the HR System's Connector Space, its own copy of what the HR system says.
- Select Admin, then Operations. On the Activity tab, select Queue a Run Profile, choose
HR Systemas the Connected System andFull Importas the Run Profile, then select Queue. - When the run finishes it moves to Completed; select it, then View Full Details to open its Activity. CSOs Added reads 25.
The HR System's Connector Space holds 25 Connected System Objects, which its Connector Space button counts.
Step 8: Synchronise¶
Run the Full Synchronisation. JIM applies both Synchronisation Rules: the import rule projects each person into the Metaverse, and the export rule finds that each of them belongs in the staff directory, so it stages an entry for each as a Pending Export.
- On the Activity tab, queue the
HR SystemConnected System'sFull SynchronisationRun Profile, and open its Activity when it finishes. MVOs Projected reads 25, and so does CSOs Provisioned. - Select Users, then All Users: Amara Okafor and the other 24 people are there, with the attributes the import rule flowed.
JIM has projected 25 Metaverse Objects, Amara Okafor (HR-1001) among them, and the Staff Directory has 25 Pending Exports waiting, which its Pending Exports button counts. Nothing has been written to the staff directory yet.
Step 9: Export to the staff directory¶
Run the Export. JIM writes each Pending Export to the staff directory file.
- On the Activity tab, queue the
Staff DirectoryConnected System'sExportRun Profile, and open its Activity when it finishes. CSOs Exported reads 25.
Then look at the file JIM wrote:
The Staff Directory has no Pending Exports left, and its file lists all 25 people, one row each, with the five columns the export rule writes.
What you achieved¶
You connected JIM to two systems and synchronised 25 identities from one to the other, through the Metaverse:
- An import read the HR file into the HR System's Connector Space.
- A synchronisation projected each person into the Metaverse, flowed their attributes, and staged an export for each to the staff directory. Its Object Matching Rule means a later run finds those people rather than creating them again.
- An export wrote them to the staff directory file.
Every run recorded an Activity, which is the place to look when a run does not go as expected; Troubleshooting Synchronisation explains each warning and error. To go further:
- Synchronisation Pipeline explains how import, synchronisation and export fit together, and the order a change needs them in.
- Synchronisation Rules covers Object Matching Rules, scoping and expressions in depth.
- Connectors lists the systems JIM connects to, directories and databases among them.
- Schedules run the steps you ran by hand, on a timetable.