Skip to end of banner
Go to start of banner

Manage Person Workflow

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 49 Next »

Objective

Develop a workflow that enables users to modify Person attributes, manage group affiliations (including addition), and assign individuals to a management role.

User ID: Test

Password: P@$$w0rd

  1. Start the 20331B-NYC-DC-05 virtual machine. Wait for the virtual machine to display the Desktop.

  2. On your Desktop, Right-click Workflow Studio (WFS), and then click Run as administrator.

  3. Wait for WFS to start and enter your credentials.

 

  1. In Solution Explorer, right-click on the Developer Packages folder, create a new folder called DemoLabs, and click the Ok button.

  1. Add New Folder dialog box will appear from it; select the following options.

  • User Interface > Lookup Control

  • User Interface > Forms

  • Workflows > Applications

And click the Ok button.

Lookup (Person)

  1. Expand the Developer Packages folder, find the DemoLabs folder, expand it under the DemoLabs folder, expand the User Interface folder right-click on the Lookup Controls folder, hover your mouse on the New User Interface option and Click on Lookup

 

  1. Wait for the Lookup designer to be loaded.

  2. Click on the Save button to save your Lookup and give it the name DemoPersonSingleLookup.

 

  1. On your lookup control set following properties

Component Object: PersonView

Data Method: GetAllSearchAdvanced method which has resourceTag as a parameter.

Decisions: Next

Set Grid Type: Person

Type: Single

  1. Publish your Lookup Control.

Form

  1. Create a form and do the following configurations on it.

Sections: Add three sections (Name, Organization, Advanced)

RBAC Components: Person (rename it to TargetPerson)

First Section (Name): Drag these fields FirstName, LastName, Description

Second Section (Organization): Drag these fields Company, Department, ValidUntil

Third Section (Advanced): Keep it empty for now.

Approval Decision: Next

  1. Right-click on Data Sources and select the Add Data Source option. Keep the Create New Data Source option selected, then click Next. In the Data Source Name textbox, provide a name for your datasource (e.g., dsDepartment). From the DataSource Type dropdown, select the CustomList option, and add the following values.

Name Value

  • IT IT

  • Marketing Marketing

  • Sales Sales

  • Finance Finance

  • HR HR

  1. Click on the Finish button.

  1. Right-click on the Description field, select the Edit option, go to the Control Types tab, and choose the MultiLineTextBox option. Check the Is Double ColumnSpan option and click OK.

  1. Right-click on the ValidUntil field and click on the edit option and go to the Standard Properties tab and set the following properties.

Min Date: 15 -----> (It implies that the earliest selectable date from the calendar control will be 15 days beyond the current date.)

Max Date: 30 -----> (It signifies that the maximum selectable date from the calendar control is set at 3 months beyond the current date.)

Default Value: 90

  1. Right-click on the Department field, select the Edit option, go to the DataSources tab, and uncheck the Use Default DataSource option and select the dsDepartment. Navigate to the Control Types tab and uncheck the Use Default Control Templates and select the DropdownList. Now navigate to the Standard Properties tab and in the Display Field dropdown select the Name and in the Selected Value Path dropdown select the Value. Click Ok button.

  1. Create an object of type boolean and rename it to EditManagementRoleMembership.

  1. Now drag the EditManagementRoleMembership object to Organization’s section

  2. Right click on the Advanced section and click on Edit option.

  3. Set the Bind Visibility to Control Value dropdown to EditManagementRoleMembership

Now, within our third section titled Advanced, I will incorporate two controls.

  • The first is an autocomplete control designed to showcase the ManagementRoles that a person is not currently associated with.

  • The second is a DataGrid control intended to display the ManagementRoles to which a person is already affiliated.

  1. Right-click on Data Sources and select the Add Data Source option. Keep the Create New Data Source option selected, then click Next. In the Data Source Name textbox, provide a name for your datasource (e.g. NewManagementRoleDatasource). From the DataSource Type dropdown, select the Generated option, in the Component Name select the ManagementRoleView and in the Method To Execute select the GetAllSearchAdvanced with the maximum number of parameters.

  1. Select the personID parameter and set the Parameter Type to Activity Primitive. Additionally, select the notAssignedToPersonID parameter, set its Parameter Type to CustomText, and input true in the Custom Value textbox. Click on the Finish button.

It’s going to show the management role that this person is not a member of.

  1. Right-click on Data Sources and select the Add Data Source option. Keep the Create New Data Source option selected, then click Next. In the Data Source Name textbox, provide a name for your datasource (e.g. NewManagementRoleStaticDatasource). In the DataSource Type select Static and in the Static Type List< write this code TheDotNetFactory.Framework.People.Components.ManagementRoleView and click on the Finish button.

  1. Right-click on the NewManagementRoleStaticDatasource and select the Create List Object for this DataSource option. Double click on the ListObject1 and rename it to NewManagementRole.

  1. Now drag and drop the NewManagementRole onto the Advance section.

  1. Right-click on the NewManagementRole grid and click on edit and go to the Control Types tab and select the AutocompleteList

  1. Go to Standard Properties tab and fill out the values as per below.

  • Display Field: FriendlyName

  • Selected Value Path: ManagementRoleID

  • Item Template Name: EidAutoCompleteManagementRole

  • Search Parameter Name: textToSearch

  • View One Link Type:

  • DataSource: NewManagementRoleDatasource

  • SearchByColumns:

  1. Click Ok.

We employed the NewManagementRoleStaticDatasource to facilitate the search for management roles within an autocomplete control. In contrast, the NewManagementRoleDatasource has been utilized for the submission of data back to the database.

  1. Right-click on Data Sources and select the Add Data Source option. Keep the Create New Data Source option selected, then click Next. In the Data Source Name textbox, provide a name for your datasource (e.g. CurrentManagementRoleMembershipDatasource). From the DataSource Type dropdown, select the Generated option, in the Component Name select the ManagementRoleView and in the Method To Execute select the GetAllSearchAdvanced with the maximum number of parameters.

  1. Select the personID parameter and set the Parameter Type to Activity Primitive. Additionally, select the showDirectPersonAssignmentsOnly parameter, set its Parameter Type to CustomText, and input true in the Custom Value textbox. Click on the Finish button.

It’s going to show the management roles that this person is a member of.

  1. Now we need to create an element in order to drag it onto our form and to do that Right-click on the CurrentManagementRoleMembershipDatasource and select the Create List Object for this DataSource option. Double click on the ListObject1 and rename it to CurrentManagementRoles.

  1. Drag and drop the CurrentManagementRoles under the Autocomplete Control.

  1. Right-click on the CurrentManagementRoles grid, select the Edit option, navigate to the Control Types tab, ensure that DataGrid is selected, and then proceed to the Standard Properties tab. In the Standard Properties tab, uncheck the Is Group Panel Visible option, checkmark the Lazy Load option, and click on Set To GridType to select ManagementRole. Click Ok.

Lookup (Groups)

  1. Create a Lookup Control

  2. Click on the Save button to save your Lookup and give it the name DemoGroupsMultiLookup.

  3. On your lookup control set following properties

Component Object: GroupView

Data Method: GetAllSearchAdvanced method which has resourceTag as a parameter.

Decisions: Submit

Set Grid Type: Group

Type: Multiple

Title: Show All Groups

  1. Publish your lookup control.

Workflows

  1. Create a workflow, save it, and give it a name, DemoManagePerson.

  2. Drag and drop your lookup control (DemoPersonSingleLookup) onto the Workflow Designer pane. In the Name property type SelectPerson.

  3. Drag and drop your form (DemoEditPersonForm) onto the Workflow Designer pane. In the Name property type EditPersonForm.

  4. Drag and drop your lookup control (DemoGroupsMultiLookup) onto the Workflow Designer pane. In the Name property type SelectGroups.

  5. Drag and drop operation base activity (EditPersonMultiOperations) onto the Workflow Designer pane. In the Name property type UpdatePerson.

  6. Drag and drop an Activity (UpdateGroupRBACMembershipActivity) onto the Workflow Designer pane. In the Name property type UpdateGroupMembership.

  7. Drag and drop an Activity (UpdateManagementRoleMembership) onto the Workflow Designer pane. In the Name property type UpdateMgmtRoleMembership.

  8. Drag and drop an Activity (System Parallel Activity) onto the Workflow Designer pane.

  9. Right-Click on the System Parallel Activity and click on the Add Branch option. It will add another branch into the System parallel Activity

  1. Now drag your UpdatePerson operation base activity into the first branch and UpdateGroupRBACMembership activity into the second branch and UpdateMgmtRoleMembership into the third branch.

  1. Now connect all your activities with a line shown as in below image

  1. Go to the Bindings tab. Expand the SelectPerson, then expand the Output. Drag and drop the SelectedValueAsComponent onto TargetPerson inside the Input/Output of EditPersonForm.

  1. Expand the EditPersonForm, then expand the Input/Outpuy. Drag and drop the TargetPerson onto the Form_TargetPerson inside the Input of UpdatePerson.

  1. Go to the Workflow Designer tab right click on the Operation Base Activity and select the Enable/Disable Executing Operations option.

  1. Move “Edit Person Organization Attributes”, “Edit Person Expiration” and “Edit LastName” from left to right. Click on the Close button.

  1. Right click on the Update Group RBAC Membership Activity and click on the Edit Get/Set Data Logic.

  1. In the SetDataCode method write below code. In the code below, we are passing the list of Groups and the selected Person to our 'Update Group RBAC Membership Activity' activity.

CurrentWorkflow.UpdateGroupMembership.TargetPersonToAdd = CurrentWorkflow.SelectPerson.SelectedValueAsComponent;
CurrentWorkflow.UpdateGroupMembership.TargetGroups = CurrentWorkflow.SelectGroups.SelectedValuesAsTList;
  1. Right click on the Update Management Role Membership and click on the Edit Get/Set Data Logic.

  1. In the SetDataCode method write below code. In the code below, we are passing the list of Management Roles and the selected Person to our 'Update Management Role Membership' activity.

      CurrentWorkflow.UpdateMgmtRoleMembership.TargetManagementRoleToAddList =
                CurrentWorkflow.EditPersonForm.Tab1AdvancedNewManagementRoleNewManagementRole_SelectedItems;

            CurrentWorkflow.UpdateMgmtRoleMembership.PersonToAdd = 
                CurrentWorkflow.SelectPerson.SelectedValueAsComponent;
  1. Right click on the EditPersonForm and click on the Edit Get/Set Data Logic.

  1. In the SetDataCode method write below code. The purpose of the code below is to display the management roles assigned to a person.

 CurrentWorkflow.EditPersonForm.DataSource_CurrentManagementRoleMembership_personID =
                CurrentWorkflow.EditPersonForm.TargetPerson.PersonGUID;
  1. In the SetDataCode method write below code. The purpose of the code below is to display the management roles in autocomplete control that has not been assigned to a person.

     CurrentWorkflow.EditPersonForm.DataSource_NewManagementRoleDatasource_personID =
    			  CurrentWorkflow.EditPersonForm.TargetPerson.PersonGUID;
  1. Publish your workflow both in the from the Workflow Studio and in UI

  2. Publish all your lookup and forms in the EmpowerID Web

  3. Run your workflow and test it.

Testing the Workflow

  1. Navigate to EmpowerID Web, proceed to Low Code Workflows, and search for your workflow— in our case, the workflow is named Demo Manage Person. Click on the link under the Run column to run the workflow.

  1. First a lookup control appears click on the search button to load it with users or search for any specific user name by writing in the search box, say “Michael Smith“.

  2. Select the first row and click on the Next button.

  3. The form will be loaded with the attributes of the previously selected user (Michael Smith).

  4. Select the department from the dropdown.

  5. Click on Edit ManagementRoleMembership; it will make the Advanced section visible with an autocomplete control and DataGrid.

  6. As of now, no management role is assigned to this user.

  7. In the autocomplete control above, search for the management role and select it.

  1. Click on the Next button. The Groups lookup control will appear. Click on the Search button to load the users.

  2. Select any group in my case, I am selecting Account Operators and Administrators.

  1. Click on the Submit button.

  2. Here you can see the execution summary

  3. Go to System Logs → Audit Log and there you can see all the operations performed against the Michael Smith.

  4. By going to the Michel Smit profile or, in your case, the user profile you selected, you can see its Group Membership and Account Attribute Changes.

  1. You can re-run the workflow and search for the same user to see if the attribute has been updated and if the management role has been assigned

  2. END.

TASK:

  1. Make the above workflow a Wizard Workflow.

  2. Implement the functionality for removing a person from groups and also removing the person from management roles.

  • No labels