Workflow Soluiton

 View Only

Altiris WorkFlow: Part 5 - Adding Components to a Basic WorkFlow Project 

May 27, 2008 03:52 PM

In this article, we will see how easy it is to add more components and features to a basic WorkFlow project. Please refer to the previous articles if you aren't familiar with basic WorkFlow.

In Part 4 we completed a workflow that would allow an employee to send a request to the IT support department.

Let's expand on the example workflow we created earlier. We would like to add the ability for our workflow system to identify the employee department and specify the day and month and which user send this request.

The first step is to search for a component called the "Embedded Rule Model". Drag and drop this component onto the working area. Connect it after the "Dialog Workflow" and before the "Send Email" component. Now right-click and choose edit Model.

Now You will see a new window (similar to the window that appears when you create a new project). The embedded rule model will take the input from the form builder.

Now we need a way to identify the user input (Department) and compare it. We need the component called "Match Rule". Drag and drop it and connect it. Right-click on the "Match Rule" and select "Edit Component".

The match rule editor window will appear. On the Evaluation Tape enter the Department Options (HR, Marketing, Sales and IT).

Note: We do not enter "Finance" later we will see why.

On the "Compare to Variable" field enter Department then OK.

Now drag and drop four more End components from Component palette under the Infrastructure category, Flow Control sub-category (or you can Copy the END component that we already using).

Rename these components as (Sales, Marketing, IT, HR, Finance) and connect them to the "match Rule" component. For more information see part 2.

Note that we connect the "No match" output with finance END component.

Then press OK.

Connect the HR to the "send email" components, now you have similar to the below WF.

Now we will search for a component called "Get currentDate". Drag and drop it to the working area. Connect it after "Embedded rule Model" and before "Send Email" components.

On the "Get currentDate" Component press right click then select "Edit Component".

Now you will see the editor window. On the "Output Variable Name" enter "CurrnetDate" then press Ok.

Now we will configure the "Send Email" component (for more information see part 2)

On the Send Email editor click on the box in the subject field and fill in the email subject. You can drag and drop any variables from the LHS menu.

Fill in the sender and recipient for this email. Also fill in the HTML for the email (you can copy the same email subject content), then press OK two times.

Now we will search for the "Get Day of Week" component. Drag and drop it in the working area. Connect it after the "Embedded Rule Model" on the Marketing output.

This component will get the day of the week as a variable. We will use it later. Right click on the "Get Day of Week" component and select "Edit component".

Now you will see the editor window. On the Result Variable Name field write "DayWeek". Press the box on the Date field. You see a small window. Check the box in the constant value (date box), and press OK two times.

Drag and drop the "Send Email" component. Connect it after the "Get Day of Week" component and before the END Component.

Press Right click on the "Send Email" Component and select edit component. Fill in the sender and recipient email address and press the box on the Subject field. As you can see we have a variable called "DayWeek" drag and drop it on the email subject as below, then click OK.

Do the same for HTML content, and then press OK two times.

Now our project will look like this.

Now we will search for the "Get Day of Month" component, drag and drop it in the working area and connect it after the "Embedded rule Model" on the Sales output.

This component will get the day of the month as variable so we will use it later. Right click on the "Get Day of Month" component and select "Edit component".

Now you will see the editor window. In the Result Variable Name field write "DayMonth". Press the box on the Date field and you see a small window. Check the box in the constant value (date box) then press OK two times.

Drag and drop "Send Email" component and connect it after the "Get Day of Month" component and before the END Component.

Press Right click on the "Send Email" component and select edit component. Fill the sender and recipient email address and press the box on the Subject field. As you can see we have variable called "DayMonth" drag and drop it in the email subject as below, then press OK two times.

Now we will search for "Get Day of Year" component. Drag and drop it in the working area and connect it after the "Embedded rule Model" on the IT output.

This component will get the day of the month as variable that we will use later. Right click on the "Get Day of Year" component and select "Edit component".

Now you will see the editor window. On the Result Variable Name fields write "DayYear". Press the box on the Date field, and you see a small window. Check the box in the constant value, then press OK two times.

Drag and drop "Send Email" Component. Connect it after the "Get Day of Year" component and before the END Component.

Right click on the "Send Email" Component and select edit component. Fill in the sender and recipient email address and press the box on the Subject field. And as you can see we have variable called "DayYear" drag and drop it on the email subject as below then press OK two times.

Now our project will look like this.

Now we will search for "Get Current User" component. Drag and drop it in the working area, then connect it after the "Embedded rule Model" on the Finance output.

This component will get Username as a variable and we will use it later. Right click on the "Get Current User" component and select "Edit component".

You will see the editor window. On the Output variable name write "UserName" and press OK two times.

Drag and drop "Send Email" component. Connect it after the "Get Current User" component and before the END component.

Right click on the "Send Email" Component and select edit component. Fill in the sender and recipient email address and press the box on the Subject field. As you can see, we have a variable called "UserName" drag and drop it on the email subject as below then press OK two times.

Now our project will look like this.

Now we ready to run our project. Click on the Execute button (the Orange Icon), right click on the composer.aspx and choose Open Browser.

Now enter your Name, your Department (we will make three tests), and enter your Description. Note the yellow line in the right-hand side. The yellow line indicate where we are now.

After you entered the required data click Submit (we select Sales department).

Now the completion form will appear. Note the yellow line on right-hand side.

Note: For More Information how to edit the Process complete form see Part 2

Open Outlook to see the new email.

We will see how the "get Current User" component works. Run the project again, this time select "finance" and click submit.

Note the process path in the right-hand side.

As you can see below, it automatically gets the username.

Finally, we will run the project again, but this time we will select the IT department to see how the "Get Day of Year" component works.

Click submit.

Open Outlook and open the email from Altiris WorkFlow.

Statistics
0 Favorited
1 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Nov 11, 2008 02:20 AM

It works now! Thank you very much!

Nov 10, 2008 01:11 PM

Get Day of Week returns a DayOfWeek type, and you can only use strings to build up subjects/text of email. Consider using a ConvertToString (ToString) component

Nov 10, 2008 11:57 AM

Result Variable ("DayWeek") of "Get Day of Week" component doesn't appear in the list of variables after connecting "Get Day of Week" and "Send E-mail" components. So it cannot be added in the email subject field.
Other variables ("DayMonth", "DayYear") appear in the list of variables under the same conditions.
This component ("Get Day of Week") seems to be out of order...

Related Entries and Links

No Related Resource entered.