15.4.2.2. Running the Sample

  1. Start OpenIDM with the configuration for the workflow sample.

    $ cd /path/to/openidm
    $ ./startup.sh -p samples/workflow
  2. Run reconciliation over the REST interface.

    $ curl
     --header "X-OpenIDM-Username: openidm-admin"
     --header "X-OpenIDM-Password: openidm-admin"
     --request POST
     "http://localhost:8080/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"

    Successful reconciliation returns an "_id" object, such as the following:

    {"_id":"aea493f5-29ee-423d-b4b1-10449c60886c"}

    The two users are added to the repository. You can test this with the following REST query, which shows the two users, manager1 and user1.

    $ curl 
     --header "X-OpenIDM-Username: openidm-admin"
     --header "X-OpenIDM-Password: openidm-admin"
     --request GET 
     "http://localhost:8080/openidm/managed/user/?_queryId=query-all-ids"
    
    {
      "conversion-time-ms": 0,
      "result": [
        {
          "_rev": "0",
          "_id": "manager1"
        },
        {
          "_rev": "0",
          "_id": "user1"
        }
      ],
      "query-time-ms": 1
    }
         
  3. Log in to the user interface as user1, with password Welcome1. For information about logging in to the user interface, see Overview of the Default User Interface.

  4. Under "Processes" click "Contractor onboarding process".

  5. Complete the details of the new user, then click Start.

    Contractor onboarding process form
  6. Log out of the UI.

  7. Log in to the UI as manager1, with password Welcome1.

  8. Under "Tasks that are in my group's queue" click "Contractor Approval".

  9. From the drop-down list, select "Assign to me".

    Note that the "Contractor Approval" task has now moved under "My tasks".

  10. Under "My tasks" click "Contractor Approval".

  11. Under Actions, click Details.

    The form containing the details of the contractor is displayed.

  12. At the bottom of the form, select a decision from the drop-down list (either "Accept" or "Reject"), then click Complete.

    If you Accept the new contractor details, the user account is created in the repository. You can check the new account by running the following REST command:

    $ curl 
     --header "X-OpenIDM-Username: openidm-admin"
     --header "X-OpenIDM-Password: openidm-admin"
     --request GET 
     "http://localhost:8080/openidm/managed/user/?_queryId=query-all-ids"
    
    {
      "conversion-time-ms": 0,
      "result": [
        {
          "_rev": "0",
          "_id": "manager1"
        },
        {
          "_rev": "0",
          "_id": "user1"
        },
        {
          "_rev": "0",
          "_id": "51afe0f8-94c3-45c5-8c69-319e6ef5981f"
        }
      ],
      "query-time-ms": 1
    }
         

    Display the details of the new user, by running a REST query on the user ID, as follows:

    $ curl
     --header "X-OpenIDM-Username: openidm-admin"
     --header "X-OpenIDM-Password: openidm-admin"
     --request GET     
     "http://localhost:8080/openidm/managed/user/51afe0f8-94c3-45c5-8c69-319e6ef5981f"
    
    {
      "city": "",
      "country": "",
      "address2": "",
      "address1": "",
      "lastPasswordAttempt": "Fri Dec 14 2012 13:54:02 GMT+0200 (SAST)",
      "passwordAttempts": "0",
      "stateProvince": "",
      "postalCode": "",
      "lastPasswordSet": "",
      "jobTitle": "Accountant",
      "department": "Finance",
      "manager": "user1",
      "familyName": "Doe",
      "givenName": "John",
      "userName": "johnd",
      "_rev": "0",
      "_id": "51afe0f8-94c3-45c5-8c69-319e6ef5981f",
      "phoneNumber": "123456789",
      "email": "johnd@example.com",
      "startDate": "12/12/2012",
      "endDate": "12/12/2012",
      "description": "Contract accountant",
      "provisionToXML": "1",
      "accountStatus": "active",
      "roles": "openidm-authorized"
    }     
         

    You can now log in to the UI as the new user (with the details that you specified in Step 5). Under "Notifications" you will see a welcome message indicating the working dates of the new user. If you log in as user1 you are notified of the result of the manager's decision.

    If you specified that the new user should be added to the original data source, you will see that the account was added to the XML file:

    $ cd /path/to/openidm
    $ cat samples/workflow/data/xmlConnectorData.xml
    ...
       >ri:__ACCOUNT__<
          >icf:__DESCRIPTION__<Contract accountant>/icf:__DESCRIPTION__<
          >ri:roles<openidm-authorized>/ri:roles<
          >ri:mobileTelephoneNumber<123456789>/ri:mobileTelephoneNumber<
          >ri:firstname<John>/ri:firstname<
          >ri:manager<user1>/ri:manager<
          >ri:startDate<12/12/2012>/ri:startDate<
          >ri:jobTitle<Accountant>/ri:jobTitle<
          >icf:__UID__<201e0d50-3313-47b3-9bd1-30c1c7dd1cee>/icf:__UID__<
          >icf:__NAME__<johnd>/icf:__NAME__<
          >ri:email<johnd@example.com>/ri:email<
          >icf:__PASSWORD__<MyPassw0rd>/icf:__PASSWORD__<
          >ri:department<Finance>/ri:department<
          >ri:endDate<12/12/2012>/ri:endDate<
          >ri:lastname<Doe>/ri:lastname<
       >/ri:__ACCOUNT__<
    ...
         

    If you declined the approval request, the user will not be created in either data source.

You can see the details of the workflow definition in samples/workflow/workflow/contractorOnboarding.bpmn20.xml.