Access Variables in 'Catalog Tasks'

moeslee
Kilo Explorer

Dear Community

I am currently implementing the Service Catalogue and have a difficult question.

I implemented some Catalog Items and also the associated Workflows with some Catalog Tasks in it.

We have a problem with the variables defined in the Catalogue Items. In the Workflow we use Catalogue Tasks
to be able to access the Variables and their value within the Workflow (with a normal 'Create Task' this isn't possible).

We have some variables that the customer provides and also some that are 'created' while the workflow.
Technically we created all Variables on the Catalogue Item and hide all them, the customer don't have to enter using a Business Rule.

What we try to achieve is, that we can define for every Catalogue Task in the Workflow, which Variables will be displayed and how (readonly or not). By checking the 'Advanced' checkbox,
a field for scripts appears. I tried many different code Snippets to set a field readOnly, but nothing worked.


Here is an example, just to make you clear what exactely I need:

Team A has a Catalog Task including all the information from the customer (readOnly).
They also see a new field "requirements" that was defined in the Catalogue Item but was disabled for the customer.
Team A now fill in some content in the field "requirements" and closes the Task.

The second Task is assigned to Team B. They now get the information of the customer (readonly) and also the 'new' field "requirements" (readOnly)
and they get 2 new fields too, where they add their content... and so on

There was a proposal to use this read_role, write_role etc. But this doesn't work for us. Team A should be able to modify "requirements" only in the Catalog Task 1
but not in Catalog Task 2 where Team B should do their work.

Does anyone know a way to solve my Problem?

Thank you in Advance

Marco

3 REPLIES 3

tony_fugere
Mega Guru

You'll have to build some advanced UI Policy with a "Run script" that will understand when to set the variable to read-only at the appropriate time. You'll likely want to have some unique indicator(s) on the form that the UI Policy can evaluate in order to understand if it should execute the read-only script.


moeslee
Kilo Explorer

Hi Tony!

Thank you for your reply. Do you have an example of this 'Advanced Client Scripting' that you could send me? Just to give me an idea about it, detailed adjustments I will be able to do by myself.

Best regards
Marco


The most advanced part will be in how you determine the condition to trigger this. This would go into the Execute if true script of a UI Policy:



g_form.setReadOnly('variables.the_variable_name', true);