Skip to main content

Blog

Go Search
Home
About
Blog
Contact
.NET
SharePoint
workflow
  

 Give us a call



(888) 731-3026 x-1
or send an e-mail
Other Blogs
There are no items in this list.
Applied Concepts Software and Consulting > Blog
WWF Programming Guide
Using SQL in the WWF Rule Condition Editor
This post discusses using SQL in the "Rule Condition Editor" of the Microsoft Workflow Foundation designer.
 
Following are screen prints showing an implementation of the concept:
Even though the WWF designer provides a graphic UI to build workflows, in real life you will quickly need to enter code.  In this case the following code was added in the Rule Condition Editor:
 
this.GetSqlBooleanValue(this.GetWorkflowContext(),
"select 'true' from emf where em_manager_id <>
'#CONTEXT(employeeId)#' and EM_EMPLOYEE_ID =
'#ORIGINATOR_ACTIVE(mssId,EM_EMPLOYEE_ID)#'",
 False)
 
 
The goal of this post is to share the concept that rule logic can be written in SQL.  Your WWF integration will need to support an asp.net method which interprets a SQL statement and returns a boolean value.  Also, your asp.net program will need to convert context information to values relative to the workflow.
 
 
State Machines with Windows Workflow Foundation
In our workflow projects we recommend State Machine workflows.  They can be built to appear as if they are sequential workflows while retaining the flexibility of a State Machine. 
 
For more information here is a link to an article on the subject of Building State Machines with Windows Workflow Foundation.
Re-Hosting the Workflow Designer

One of the projects we are working on involves the re-hosting of the Workflow Designer which comes with Microsoft Workflow Foundation. We are especially pleased to participate in this joint project which includes the development group from a software development company with a best of bread HR/Payroll application; an outstanding client who has put a lot of effort into their workflow requirements; and Applied Concepts Software and Consulting (ACSC).

Our roll in this effort is to create a custom Personal Action Form (PAF) and the workflows to support multiple events (i.e. salary change, position change, termination, new hire, etc).

In addition we are working with the vendor for the HR/Payroll application to insure the custom PAF and workflows work with their re-hosting of the Workflow Designer and their integration of the Microsoft Workflow Foundation engine.

Following is a screen shot showing the re-hosted workflow designer. Also, this link takes you to a MSDN article which discusses Re-Hosting the Workflow Designer.



In this example please note:

  1. The circled "designer" menu option on the left.  This is where the workflow designer is integrated into the HR/Payroll applications menu.  The screen print shows the designer overlaying the application after it was selected from the application menu.
  2. Also, please note the circled activities on the right hand menu of the designer.  These are two of the custom activities written to integrate the Microsoft Workflow Foundation into the application

More on this in future blog post.

Support multiple langauges
One of the applications I work with has a user preference page which includes a dropdown box which allows the user to set the language preference. 


In this case the selection options include English US, English Canadian, French Canadian, and Spanish. 
 
To implement this metadata is used to replace the labels, on each page based on the language preference of the user.  The programs are written in C# which supports inheritance.  As a result the page rendering logic is all in one place.  As a result overriding the labels  is a fairly straight forward task. 
 
However, that is only half the challenge.  The data needs to be supported in multiple languages as well.  In this example each database table has a corresponding language table.  For example there is an employee master table (EM) and a corresponding EM_Lang table.  For each record on the employee table there may be multiple records on the EM_Lang table.  Columns which can possibly be maintained in multiple languages appear in the EM_Lang table.
SharePoint best practice: Creating Custom Master Pages
There are several good articles on this subject. Following are a couple of articles of interest:

I mention this because even when a change does not change the look and feel (i.e. defining your brand), it is often wise to make a copy of the default master page and add your changes.

For example, adding a statistics counter to a SharePoint website does not change the look and feel however the easiest place to add the statistics JavaScript is in the master page.  As a result one should:

  1. copy the default master page
  2. add the JavaScript to your custom master page
  3. change your site settings to point at the custom master page.

PS: Although you may want to use a stat counting service such as www.statcounter.com it is also possible to create a hit counter completely within SharePoint.  Following is an article on the subject:  How to create a page and add a hit counter in SharePoint Designer 2007

AJAX integration in ASP.NET pages
 
AJAX has become a common aspect of ASP.NET development.  And in fact the programming to implement an AJAX method is relatively simple.  Specifically because it is an island of logic.  There is normally a straight forward requirement with limited impact on other aspects of the page and the application as a whole.
 
In the example completed recently a custom Manager Self Service page required that position and department descriptions be presented after entry without a post back to the server.

MSS page after an AJAX lookup of a position title
 

A more complex example, completed last week involved the display of a dropdown box to select salary from a list of steps specific to employees in unions.  What made that a challenge is the JavaScript required to dynamically create a dropdown box.  Fortunately there are numerous examples available which can be found via a Google search.  Also, the application we were working with had another example which we leveraged.
Starting over
Hopefully the sever response will be better this time.  For the last several months I have used a virtual server from VPSland.  The server response was not satisfactory so I have moved to Apps4Rent.  
 
For history you can visit my HR/Payroll website
  

 ‭(Hidden)‬ Admin Links