README
Async reconciliation Sample
-------------------------
Copyright (c) 2012 ForgeRock AS
This work is licensed under a Creative Commons Attribution-
NonCommercial-NoDerivs 3.0 Unported License. See
http://creativecommons.org/licenses/by-nc-nd/3.0/
This sample demonstrates how perform an asynchronous action from a reconciliation.
To try the sample, follow these steps.
1. Copy the sample configuration and data.
$ cd /path/to/openidm
$ cp -r samples/sample9/conf samples/sample9/workflow .
2. Start OpenIDM.
$ ./startup.sh
3. Run reconciliation.
$ curl -u openidm-admin:openidm-admin -X POST "http://localhost:8080/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"
4. The reconciliation starts an approval workflow for each ABSENT user.
These workflows (managedUserApproval) wait for approval.
5. Query the started workflow task instances.
$curl -u openidm-admin:openidm-admin "http://localhost:8080/openidm/workflow/taskinstance?_queryId=query-all-ids"
sample response:
{"result":[{"_id":"26","name":"Evaluate request"},{"_id":"16","name":"Evaluate request"}]}
6. Approve the requests.
$curl -u openidm-admin:openidm-admin -X POST "http://localhost:8080/openidm/workflow/taskinstance/16?_action=complete" --data '{"requestApproved": "true"}'
$curl -u openidm-admin:openidm-admin -X POST "http://localhost:8080/openidm/workflow/taskinstance/26?_action=complete" --data '{"requestApproved": "true"}'
7. Query the managed users created by the async reconciliation after the approval step.
$curl -u openidm-admin:openidm-admin "http://localhost:8080/openidm/managed/user?_queryId=query-all-ids"
The sample is also availeble with the -p samples/sample9 option now.
For testing the sample you might want to copy the following into a an exacutable text file and run it:
echo "copy the workflow and wait for 3 seconds to deploy"
cp openidm/samples/sample9/workflow/managedUserApproval.bar openidm/workflow/
sleep 3
echo "run recon and then wait for 3 sec to get the instance id"
curl -u openidm-admin:openidm-admin -X POST "http://localhost:8080/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"
sleep 3
curl -u openidm-admin:openidm-admin "http://localhost:8080/openidm/workflow/taskinstance?_queryId=query-all-ids"
echo ""
echo "now run the following after replacing XX with the taskinstanceNumber (the _id property) from above!"
echo 'curl -u openidm-admin:openidm-admin -X POST "http://localhost:8080/openidm/workflow/taskinstance/XX?_action=complete" --data '\''{"requestApproved": "true"}'\'