Datapolis Process System

Search:

Contents
:
IndexBookmarkPrint
Home > User Guide > Creating Workflows > Workflow Designer > Activities

Activities

 

During transition between states, you might want to perform some additional operations, for example send an e-mail to a user who will have a task to perform in the next state. You can achieve this by using activities – small programs performing a given operation or operations. Activities can be set in a desired order, you can also execute activities when certain conditions are met.

 

Activity Diagram


Activities are placed on a special diagram – activity diagram – which can be accessed through the action properties window.  Each action can have a unique set of activities.

Add Activity


Adding activities to the diagram is very simple: you just drag them from the list on the right and drop them on the diagram:

 

Edit Activity


When you have added a new activity to the diagram, you might want to edit the activity’s parameters. Double-click on the activity or click the pencil icon in the top-right corner of the activity. A new window will open:

In this window you have a brief description of the activity, telling you what operation it performs.

 

You can change activity’s displayed name and set the parameters the activity takes. Some of them might be required (marked with an asterisk) and you must provide them with a value; otherwise the activity will not run properly.

 

You can see a description of each parameter in a tooltip: just point your mouse cursor over the small   icon next to the parameter you want to learn about or over its name.

 

You can reuse activities that you have already defined, retaining its parameters, so that you won’t have to set them again. Just drag the chosen activity from the diagram and drop it on the list on the right. The “Clipboard” tab will be opened automatically and your activity will appear on the copied activities list. If you want to use this activity elsewhere, simply drag and drop it from the clipboard to the diagram.

The clipboard is shared for all actions, so you can copy activities from one action to another.

 

Also, the clipboard is saved with workflow definition, so you can exit the Designer without losing copied activities.

 

Loop Activities


There might be a situation when you would like to repeat a set of activities several times, for instance when you are processing a number of list items. Building multiple sets of activities may be tiresome, plus it will increase the workflow’s size and decrease its performance. A good idea is to use loops.

 

Loops are activities in which you can nest a set of other activities (including other loops), which will be executed a number of times.

In Datapolis Process System there are two loop activities, each being a loop of a different type:

  • While loop
  • For each item loop

The While loop (or simply “Loop”, as the activity is named) iterates for as long as its conditions are met (unless the maximum number of iterations is constricted).

 

The For each activity (or “For each item”) first retrieves a collection of list items that meet defined conditions, and then runs for each of the items. The number of iterations is the number of retrieved items.

 

Note: The items are retrieved only once, at the start of the activity.

Important:

 

To use the loop activities, you must first enable the WhileActivity type in your web.config file. To do this, navigate to your Web Application’s virtual directory (usually a C:\inetpub\wwwroot\wss\VirtualDirectories\port number on which your Web Application is running). Open the web.config file (you can use Notepad, for it is a text file). Navigate to line:

 

<authorizedType Assembly="System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Workflow.*" TypeName="WhileActivity" Authorized="False" />

 

(It should be in configuration/System.Workflow.ComponentModel.WorkflowCompiler/authorizedTypes section.)

 

Change the Authorized attribute from False to True, so that the line will look like:

<authorizedType Assembly="System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Workflow.*" TypeName="WhileActivity" Authorized="True" />

 

Save the file. Now you should be able to successfully deploy and launch workflows with loop activities.

 

If you do not perform this routine, workflows with loop activities will not deploy.

 

Please note that there is a risk of a severe performance decrease of the whole SharePoint infrastructure if an infinite loop is executed. Make sure that you define loop conditions with care, also be sure to set a maximum allowed number of iterations, which will help to control any unexpected situations.