Result of Catalog Task to Drive workflow

Sam Ogden
Tera Guru

Hi All,

I'm in the middle of creating a new workflow for a Catalog Item.

I have multiple catalog tasks being generated.  After one of the Catalog tasks, I want to workflow to follow different paths depending on the outcome of the catalog task.

On the Catalog Task there is a field u_job_category.  For this Catalog task this choice field will be set to one of the 3 following options:

  1. Cost Accepted
  2. Cost Rejected
  3. Re-Scope Requested

Depending on the option returned in this field will depend the route the workflow should take.

How do I get this to happen in my workflow.?

The catalog task is set to not wait for completion.  I then will have a wait condition to wait for the value of u_job_category.

Once one of the 3 values is returned the workflow needs to go to a switch to decide the path to be taken.

I just need to know how I can access the value of u_job_category from that catalog task?

Thanks

Sam

4 REPLIES 4

Pedro Lopez
Kilo Guru

Hi Sam,

There is a workflow activity called "Switch", where you can specify the field name, this case u_job_category, and based on the choices, you can take different paths. Other option is to use "If", but on this one you will need to re-configured based on your choices.

 

Hope this helps,

Pedro Lopez

lukasrudaitis
Tera Expert

Hello Sam,

Interesting problem you have here, so I decided to dig deeper in to this.

I got the things working as expected, but not sure what consequences this customization could have. I guess I will leave it to you.
Lets begin:

On the sc_task table, field 'state' add new states according to your needs. (I guess you can you some script later on to hide these states from the list for other tasks).

So I have new state - 58, i didn't bother to create all three.

find_real_file.png

Now there is a script include 'TaskStateUtil'. On line 27 you should include all your newly created states. This way the the task will become active = false, when you will select any of these states. It is necessary as workflow waits until task becomes inactive. 

find_real_file.png

Now there is a business rule SNC - Run parent workflows. You need add your new states to conditions:

find_real_file.png

I have created UI actions on sc_task to set the state as needed. You could probably add some conditions to show these UI actions to certain users who will be handling these tasks.

find_real_file.png

I have this simple workflow:

find_real_file.png

 

And condition '58' looks like this:

find_real_file.png

And this is the result, workflow moves forward and new task is created.

find_real_file.png

Well it looks pretty ugly, but it works. I didn't do any other testing, so its on you how it will affect other functionality of sc_task and related items.

 

Hi,

 

Thanks for the above detailed info.

I was wondering if it is possible to get this to work using a field other than 'state'.

Ideally I don't want to have a load of new states, instead we have a separate custom field u_job_category which contains these values.

If possible I would want to have 3 options from the catalog task based on the value in u_job_category?

Thanks

Sam

lukasrudaitis
Tera Expert

Ok, it seems I went too deep and focused too much to make it work on catalog task activity..

Workflow:

find_real_file.png

Run script after the task is closed complete:

 

find_real_file.png

Add workflow conditions on 'run script' activity.

find_real_file.png

Result:

find_real_file.png