Triggering a workflow only if specific fields are changed. Also use of User Defined SQL Functions.
Request: An emPath user recently asked the following:
What I would like to do is to only implement the workflow for a specific field. So for example, lets say we setup a workflow on the Bio Details page. This page has a very large collection of fields such as SSN, hire date, names but, we only want to trigger a workflow when the name fields are modified. Therefore, we would need to reference some object that contains which fields have been modified. I assume in order to do that, you would need a rule. If so, could you tell me how I would access what fields changed in a rule?
Solution: I provided an example workflow which used if/else logic within the captureUserInput stateactivity. This logic conditionally triggered a WF based on the change ofspecific fields on the EmBioDetails page.
The workflow test to see if name fields (i.e. title, last name, first name, middle initial, name suffix, nickname, etc) have changed. If so an approval workflow is triggered. Following is a screen print showing the if/else logic in the workflow designer.
Note: Following is the expression used in the declarative rulecondition. Note that it uses the GetSqlBooleanValue method. IMHO this is the mostpowerful exposed method available to workflow users. this.GetSqlBooleanValue("captureUserInputActivity1", "select dbo.exampleHaveNameFieldsChanged ('#ORIGINATOR_ACTIVE(employee, EM_EMPLOYEE_ID)#', '#DATA(txtEmNameTitle)#', '#DATA(txtEmLastName)#', '#DATA(txtEmFirstName)#', '#DATA(txtEmMiddleInitial)#', '#DATA(txtEmNameSuffix)#', '#DATA(txtEmNickname)#', '#DATA(txtEmPreferredGivenName)#', '#DATA(txtEmLegalName)#', '#DATA(txtEmFormerName)#', '#DATA(txtEmNameAtBirth)#') from swd1", False)
Add Your Comments
|
Last Modified:Saturday, July 24, 2010
Last Modified By: Denton Harryman
Type: HOWTO
Article not rated yet.
Article has been viewed 1,294 times.
|