Project - Workflow - Redirection based on the workload category

Hello,

In the project Workflow, we want to redirect to a validation step based on the workload category of the project.

For example, if the workload category of the project is "Strategic", the validation must go to the Team A. If it's "Not Strategic", the validation must go to the team B.

Actualy, I can't find how to do this redirection because the workload category is not available in the Validation / Tokens.

Parents
  • Hi Sébastien,

    Workload category is defined in the project settings, but not in the project details fields - so as you said it doesn't have any token to access it directly from the workflow.

    However, you can easily get the value of a workload category from a SQL query as long as you know the project_id - and you have this available in your workflow with a token.

    So just write a SQL query that retieve the workload category from table PM_PROJECT_TYPES in column WORK_LOAD_CATEGORY_CODE. I know that the table name is misleading, but despite its name this table will contain one row for each project. Just look for the right value of column PROJECT_ID. 

    Now you can easily run this query in your workflow and follow the right path based on the value of the project's Workload category.

  • We did the followinf modification but an error "Token non valide" is displayed at the step.

    Validation

    A validation "Project Types Query" has been created to return all the workload categories.
    This valdiation is used by the workflow execution step to redirect based on the workload category of the project.

    SQL Query : select kl.lookup_code, kl.meaning from knta_lookups kl where kl.lookup_type = 'RSC - Workload Category Code'

    Workflow

    Valdiation : Project Types Query

    Execution : select ppt.work_load_category_code from pm_project_types ppt
    join knta_lookups kl on kl.lookup_code = ppt.work_load_category_code and kl.lookup_type = 'RSC - Workload Category Code'
    where ppt.project_id = [PRJ.PROJECT_ID]

Reply
  • We did the followinf modification but an error "Token non valide" is displayed at the step.

    Validation

    A validation "Project Types Query" has been created to return all the workload categories.
    This valdiation is used by the workflow execution step to redirect based on the workload category of the project.

    SQL Query : select kl.lookup_code, kl.meaning from knta_lookups kl where kl.lookup_type = 'RSC - Workload Category Code'

    Workflow

    Valdiation : Project Types Query

    Execution : select ppt.work_load_category_code from pm_project_types ppt
    join knta_lookups kl on kl.lookup_code = ppt.work_load_category_code and kl.lookup_type = 'RSC - Workload Category Code'
    where ppt.project_id = [PRJ.PROJECT_ID]

Children
  • Verified Answer

    Hi Sébastien,

    1) No need to create a new validation - just open the "RSC - Workload Category" existing validation (that defines available categories), and check the "Use In Worfklows?" checkbox.

    2) Use this "RSC - Workload Category" in a new Execution step, type "SQL Statement", with "immediate" execution, and enter the following SQL query:

    select ppt.work_load_category_code, ppt.work_load_category_code from pm_project_types ppt
    where ppt.project_id = [REQ.P.KNTA_PROJECT_PLAN]

    Two things here:

    - No need to join on the Lookup table

    - The Project context is not available to workflow for [PRJ] tokens. So you can either use some workflow parameter to pass the Project ID, or do as I did here and leverage the Project Details (i.e. Request) field that stores the project ID.

    Now add this execution step to your workflow, and from this SQL execution step, you can decide what path to take in your workflow depending on the value of the returned workload category. Works fine from my testing, let me know if you can get the same results.

  • Hello Etienne,

    This is working as expected.

    Thank you for your help