Complete a First Business Process Design

This tutorial teaches you how to complete the main flow of a business process. Learn how to assign a task to a specific user. Add rules and validations using callback actions.
Don't have the Agile Platform? Download it here!

Tutorial Transcript

This section presents a transcript of the tutorial contents for documentation purposes only.
These tutorial instructions appear in Service Studio within the full application context.

Download baseline eSpace


Step 1
Evolve the Process
In this tutorial we're going to build up the process flow, restrict user access to tasks, and automate some of the end-user actions using the process.

      
  1. Under Processes, double-click on the  CandidateSelection process to display its flow

Step 2
Create a Human Activity
We're going to add a second  Human Activity to the process flow.
(Take note of these actions for the next step)
  1. Drag the  Human Activity, drop it onto the connector when it glows, and type ValidateCV for the name
  2. In the Destination property select the Candidates\Candidate_Show, and then in the  CandidateId select the  CandidateId
  3. Double-click on Detail and set the expression to: 
    GetCandidate(CandidateId).Candidate.Name
    Close the Expression Editor
  4. Double-click on Instructions and set it with the following text:
    Validate the candidate's CV.
    If ok, set the candidate's status to 'Schedule Interviews'.
    Otherwise, dismiss the candidate.
    Close the editor
  5. Uncheck all of the Roles except the DepartmentManagers role

Step 3
Complete the Human Activites Flow
Let's add two more  Human Activities to the flow to have a first version of the complete process.

NOTE: Set the Destination and Detail properties with the same values as in  ValidateCV
  1. Add a  ScheduleInterviews, set the Destination and Detail, set the Instructions to: 
    Add an interview with Daniel Mann.
    Set the candidate's status to 'NeedsApproval'.
    Uncheck all of the Roles except the AdministrativeAssistants role
  2. Add a  ApproveCandidate, set the Destination and Detail, set the Instructions to: 
    Set the candidate's status to 'Approved' or dismiss the candidate. 


Step 4
Great Work!
You've completed your first  Process flow! 

You've used 
 Human Activities and built up the process flow for a candidate selection.

You've also used 
 Roles to grant user group access to each  Human Activity. Later on in this tutorial we'll grant access only for a specific user.

Click 
NEXT to continue.

Step 5
Deploy the Application
Let's deploy the application with the changes.
  1. Click on the  1-Click Publish button.
  2. Wait for the 1-Click Publish to finish...

Step 6
Let's Test the Application!
  1. Open the application in the browser by clicking Open in Browser
  2. Follow the next steps to test your application

    Click 
    NEXT to start testing

Step 7
Screen the Candidate
  1. Log in using anne.abbott@mail.com/outsystems
  2. Create a new candidate: type in a name, set the Position to Software Engineer, and the Status to New.
  3. Open the candidate's task on the Taskbox
  4. Edit the candidate and update the status to Validate CV
  5. Click Done! on the Taskbox
  6. Log out

    Click 
    NEXT to continue testing

Step 8
Validate the Candidate's CV
  1. Log in using daniel.mann@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Edit the candidate and update the status to Schedule Interviews
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue testing

Step 9
Schedule Interviews
  1. Log in using anne.abbott@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Add a an interview with Daniel Mann
  4. Edit the candidate and update the status to Needs Approval
  5. Click Done! on the Taskbox

    Click 
    NEXT to continue testing

Step 10
Approve the Candidate
  1. Open the candidate's task on the Taskbox
  2. Edit the candidate and update the status to Approved
  3. Click Done! on the Taskbox
  4. Log out

    Click 
    NEXT to continue the tutorial

Step 11
Grant User Access to a Human Activity
We're going to grant access to a manager end-user to see and carry out  ApproveCandidate tasks.
  1. Double-click on the User property and set it to GetManagerForCandidate(CandidateId)
    Close the editor

Step 12
Great!
You've just granted access to an end-user to tasks generated by a  Human Activity. By doing this, the user you have set will be the only one to be able to see the task in his Taskbox and carry it out.

You've learned the two ways of granting access to tasks in the Taskbox: 
  • Set  Roles for role access which normally comprises a group of end-users
  • Set the User for a specifc end-user access

Click 
NEXT to continue.

Step 13
Deploy the Application
Let's deploy the application with the changes.
  1. Click on the  1-Click Publish button.
  2. Wait for the 1-Click Publish to finish...

Step 14
Let's Test the Application!
  1. Open the application in the browser by clicking Open in Browser
  2. Follow the next steps to test your application

    Click 
    NEXT to start testing

Step 15
Screen the Candidate
  1. Log in using anne.abbott@mail.com/outsystems
  2. Create a new candidate: type in a name and set the Position to Software Engineer
  3. Open the candidate's task on the Taskbox
  4. Edit the candidate and update the status to Validate CV
  5. Click Done! on the Taskbox
  6. Log out

    Click 
    NEXT to continue testing

Step 16
Validate the Candidate's CV
  1. Log in using daniel.mann@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Edit the candidate and update the status to Schedule Interviews
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue testing

Step 17
Schedule Interviews
  1. Log in using anne.abbott@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Add an interview with Daniel Mann
  4. Edit the candidate and update the status to Needs Approval
  5. Click Done! on the Taskbox
  6. Log out

    Click 
    NEXT to continue testing

Step 18
Approve the Candidate
  1. Log in using paula.weldon@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Edit the candidate and update the status to Approved
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue the tutorial

Step 19
What's Next?
In the following steps we're going to add  On Close actions that are triggered right before a  Human Activity task is ended.

They're going to be designed to automatically update the candidate's status and this way remove the manual step of updating the status: the end-user just has to close the task!


These actions are called 
 Callback Actions.

Click 
NEXT to continue.

Step 20
Add a Callback to a Process Activity 
Let's automatically update the candidate's status when a  ScreenCandidate is done.
  1. Right-click on  ScreenCandidate and select the  Add On Close option
  2. Drag the  SetCandidateStatus user action and drop it onto the connector when it glows
  3. In the drop list of the  CandidateId argument, select the  CandidateId
  4. In the drop list of the  StatusId argument, select the Entities.Status.ValidateCV
  5. Click on  Raise Error, press Delete, click on  If, and press Delete again
  6. Click on  ScreenCandidate, double-click on Instructions and update the text to:
    Check if the name and position are filled. 
    If yes, close the task.
    Otherwise, dismiss the candidate.
    Close the editor

Step 21
Add a Second Callback
Let's add a second   On Close callback action when a  ValidateCV is done.
  1. Right-click on  ValidateCV and select the  Add On Close option
  2. Drag the  SetCandidateStatus user action and drop it onto the connector when it glows
  3. In the drop list of the  CandidateId argument, select the  CandidateId
  4. In the drop list of the  StatusId argument, select the Entities.Status.ScheduleInterviews
  5. Click on  Raise Error, press Delete, click on  If, and press Delete again
  6. Click on  ValidateCV, double-click on Instructions and update the text to:
    Validate the candidate's CV.
    If ok, close the task.
    Otherwise, dismiss the candidate.
    Close the editor

Step 22
Add a Third Callback
Let's add a third   On Close callback action when a  ScheduleInterviews is done.
  1. Right-click on  ScheduleInterviews and select the  Add On Close option
  2. Drag the  SetCandidateStatus user action and drop it onto the connector when it glows
  3. In the drop list of the  CandidateId argument, select the  CandidateId
  4. In the drop list of the  StatusId argument, select the Entities.Status.NeedsApproval
  5. Click on  Raise Error, press Delete, click on  If, and press Delete again
  6. Click on  ScheduleInterviews, double-click on Instructions and update the text to:
    Schedule interviews for the candidate and close the task.
    Close the editor

Step 23
Well Done!
You've just added the  On Close callback action 
to replace the manual step for updating the status.


Use 
 Callback Actions to evolve your processes, introducing rules and validations, or even tie in with the application logic.

Click 
here to learn more about Callback Actions.

Click 
NEXT to continue.

Step 24
Deploy the Application
Let's deploy the application with the changes.
  1. Click on the  1-Click Publish button.
  2. Wait for the 1-Click Publish to finish...

Step 25
Let's Test the Application!
  1. Open the application in the browser by clicking  Open in Browser
  2. Follow the next steps to test your application

    Click 
    NEXT to start testing

Step 26
Screen the Candidate
  1. Log in using anne.abbott@mail.com/outsystems
  2. Create a new candidate: type in a name and set the Position to Software Engineer
  3. Open the candidate's task on the Taskbox
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue testing

Step 27
Validate the Candidate's CV
  1. Log in using daniel.mann@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Click Done! on the Taskbox
  4. Log out

    Click 
    NEXT to continue testing

Step 28
Schedule Interviews
  1. Log in using anne.abbott@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Add a an interview with Daniel Mann
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue testing

Step 29
Approve the Candidate
  1. Log in using paula.weldon@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Edit the candidate and update the status to Approved
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue the tutorial

Step 30
What's Next?
In the following steps we're going to pass process information to the application.

We're going to use the process information to display (or not) an 
Approve button and close the  ApproveCandidate task for the end-user when he presses the Approve button.

Click 
NEXT to continue.

Step 31
Pass the Activity Name to the UI
We're going to pass the name of the process activity to the application's  Web Screens.
  1. Right-click on  Candidate_Show, select  Add Input Parameter, type CurrentStep for the name, and set IsMandatory to No
  2. Click on  ApproveCandidate and set the CurrentStep argument to "ApproveCandidate"
  3. Right-click on  Candidate_Edit, select  Add Input Parameter, type CurrentStep for the name, and set IsMandatory to No
  4. Double-click on  Candidate_Show, select the  Edit button and set the CurrentStep to  CurrentStep

Step 32
Pass the Activity Identifier to the UI
Now, let's also pass the Identifier of the process activity to the application's  Web Screens
  1. Right-click on  Candidate_Show, select  Add Input Parameter, type ActivityId for the name, set the Data Type to Activity Identifier, and set IsMandatory to No
  2. Click on  ApproveCandidate, double-click on ActivityId, and double-click on the ActivityId runtime property
    Close the editor
  3. Right-click on  Candidate_Edit, select  Add Input Parameter, type ActivityId for the name, set the Data Type to Activity Identifier, and set IsMandatory to No
  4. Select the  Edit button and set the ActivityId to  ActivityId

Step 33
Great Work!
You've just passed the information about the execution status of your process flow to the application's  Web Screens through:
  • Text parameter for the name of the executing process activity
  • An Activity Identifier parameter for the identifier of the executing process activity
Click NEXT to continue.

Step 34
Show a Button for a Specific Activity
Let's add an  Approve button to the UI, use the  CurrentStep parameter to make it visible only for tasks of the  ApproveCandidate human activity.
  1. Double-click on  Candidate_Edit to open it
  2. Drag a  Button and drop it between the  Save and  Dismiss buttons
  3. Type "Approve" for the Label  and set the Visible property to:
    CurrentStep = "ApproveCandidate"

Step 35
Use a Button to Close an Activity
Now, let's design the  Approve flow to update the candidate's status and use the  ActivityId to close the  ApproveCandidate task in the Taskbox.
  1. In the Destination property select the (New Screen Action) option
  2. Double-click on Approve, drag the  SetCandidateStatus user action and drop it onto the connector when it glows
  3. Set CandidateId for the StatusId argument and Entities.Status.Approved for the StatusId argument
  4. Drag the  CloseApproveCandidate process action, drop it onto the connector when it glows, and set ActivityId for the ActivityId argument
  5. Drag a  Destination, drop it onto the  End, element and select  Candidate_List

Step 36
Deploy the Application
Let's deploy the application with the changes.
  1. Click on the  1-Click Publish button.
  2. Wait for the 1-Click Publish to finish...

Step 37
Let's Test the Application!
  1. Open the application in the browser by clicking  Open in Browser
  2. Follow the next steps to test your application

    Click 
    NEXT to start testing

Step 38
Screen the Candidate
  1. Log in using anne.abbott@mail.com/outsystems
  2. Create a new candidate: type in a name and set the Position to Software Engineer
  3. Open the candidate's task on the Taskbox
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue testing

Step 39
Validate the Candidate's CV
  1. Log in using daniel.mann@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Click Done! on the Taskbox
  4. Log out

    Click 
    NEXT to continue testing

Step 40
Schedule Interviews
  1. Log in using anne.abbott@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Add a an interview with Daniel Mann
  4. Click Done! on the Taskbox
  5. Log out

    Click 
    NEXT to continue testing

Step 41
Approve the Candidate
  1. Log in using paula.weldon@mail.com/outsystems
  2. Open the candidate's task on the Taskbox
  3. Edit the candidate and click on Approve
  4. Log out

    Click 
    NEXT to continue the tutorial

Step 42
Congratulations!
You have successfully completed this lesson. Now you know how to:
  • Build a complete process flow
  • Assign a  Human Activity to a specific end-user
  • Use a  On Close callback action when a process activity is closed
  • Pass runtime info to the UI about the current process activity, including the Activity Identifier
  • Use the  Close<ActivityName> process action to close an ongoing activity

Click 
FINISH and move on to the next lesson.

What IT pros like you say about the Agile Platform

It’s rare that I’m really impressed by software [...] but the Agile Platform is one heck of a product.”

Joshua Price, MakeTechEasier

It does what it claims to do, and does it well. In this industry, that is extremely unique.”

Justin James, TechRepublic

I'm blown away by this tool, it's depth, and the level & quality of training you provide.”

T.S. - Developer

Training & Certification.

Want to become a pro and extend you knowledge with in-depth training? See our training program.

Agile Network community.

Download samples and technical resources, get help from peers, or discuss your favorite development topics in the forums. Check out the Agile Network.

Free Download.

Start creating your next great web app with the Agile Platform! Download now.

Great web apps of all types.

The Agile Platform™ is being used to build custom web applications and websites - from apps used by dozens of employees to global web portals used by millions of users. Custom CRMs, Intranet Portals, HR solutions, eCommerce sites, Invoicing and Billing Systems... there's no limit to the type of web applications you can build.

Great companies of all sizes.

The list of companies using the Agile Platform™ spans from startups to Fortune 50 companies in 16 countries and across 19 industries including Banking, Telecom, Insurance, HealthCare, Consumer Goods, Distribution, Manufacturing, Utilities, Education and Government.