We have a usecase to set a property's value automatically: based on several conditions that property gets a value. First we considered creating a desktop plan for this. Then we figured it would be preferrable to have this value set automatically, something that can possibly be accomplished by applying computed content.
Yes, sql-like case stamenent can be implemented as computed content. See below a simple example of a computed content property for Catalog Item entity, serving a purpose of defining a status whether it is reviewed by Data Steward or not based on the description property.
Catalog Item when description is null, custom property shows “PENDING”.
Catalog Item when description is not null, custom property shows “READY”.
Configuration of Catalog Item entity in Metadata Model
Configuration of the computed content entity:
Here is the SQL query:
1select
2 a.id_i ,
3 a.parent_id_i,
4 a.from_h ,
5 a.path_i ,
6 a.type_i ,
7case
8when catalogitem_description isnullthen'PENDING'
9else'READY'
10endas status,
11 concat( 'https://mdm-server-one-fyg1u.worker-01-euc1.prod.ataccama.link/runWorkflow?id=WF1:export_all_instance.ewf&inputId=', a.id_i) as url
12from
13 (
14select
15 ci.$ci_id$ as id_i ,
16 ci.$ci_id$ as parent_id_i,
17 ci.$ci_from$ as from_h ,
18 $path(ci.$ci_path$)$ as path_i ,
19 $type()$ as type_i ,
20 ci.$ci_name$ as catalogitem_name,
21 ci.$ci_def$ as catalogitem_description,
22 ci.$ci_id$ as catalogitem_gid
23from
24 $ci$ ci
25 ) as a
Hope this helps! If you have any questions, let me know in the comments below!
Yes, sql-like case stamenent can be implemented as computed content. See below a simple example of a computed content property for Catalog Item entity, serving a purpose of defining a status whether it is reviewed by Data Steward or not based on the description property.
Catalog Item when description is null, custom property shows “PENDING”.
Catalog Item when description is not null, custom property shows “READY”.
Configuration of Catalog Item entity in Metadata Model
Configuration of the computed content entity:
Here is the SQL query:
1select
2 a.id_i ,
3 a.parent_id_i,
4 a.from_h ,
5 a.path_i ,
6 a.type_i ,
7case
8when catalogitem_description isnullthen'PENDING'
9else'READY'
10endas status,
11 concat( 'https://mdm-server-one-fyg1u.worker-01-euc1.prod.ataccama.link/runWorkflow?id=WF1:export_all_instance.ewf&inputId=', a.id_i) as url
12from
13 (
14select
15 ci.$ci_id$ as id_i ,
16 ci.$ci_id$ as parent_id_i,
17 ci.$ci_from$ as from_h ,
18 $path(ci.$ci_path$)$ as path_i ,
19 $type()$ as type_i ,
20 ci.$ci_name$ as catalogitem_name,
21 ci.$ci_def$ as catalogitem_description,
22 ci.$ci_id$ as catalogitem_gid
23from
24 $ci$ ci
25 ) as a
Hope this helps! If you have any questions, let me know in the comments below!
Thanks for your example. I'll give it a try to make it fit our usecase. Likely I will have a follow-up question about joining tables, which works different as compared to regular SQL, because in our usecase the case statement will use logic involving several entities. But I will give it a shot myself first.
I wanted to apply your input, but I ran into the following. One of the entities that I need in the computed content is an extension of term. When trying to add this it cannot be selected (not visible in the dropdownbox). I can see term itself, but none of the extensions of term that I created. Is that expected behaviour (version 13.9)? Otherwise I'll contact support.
HI @abir I am trying to implement similar solution. Below are my configurations: When I create referenced object in catalog item and reference computedContent, it gives error that it cannot be referenced. Do I create arbitrary referend object?
Indeed you cannot reference to the computed content directly. It should work by following these two steps:
In the create an ‘embedded object’ property, where the object is your computed content entity.
Create a ‘delegated scalar property’, with ‘Via property’ being the name of the computed content entity (in your case ‘computedContent’) and the ‘Delegate property’ being the name of the property in ‘computedContent’ that you want to apply (so in your case ‘layer').
I forgot to update you regarding the follow-up from Ataccama Support, that investigated why the computed content didn't work for my example.
In short, the issue is that one of the entities that I need in the computed content is an extension of term. When trying to add this entity in the computed content screen it cannot be selected (it is not visible in the dropdownbox).
The feedback I received was that it is considered a bug, being fixed in version 15.4.
Hello, I need further support. I need to join attribute and termInstance but getting error when I bring in attribute of display name from termInstance.
Also trying different approach but giving different error , support here would be appreciated:
Hi community,
We have a usecase to set a property's value automatically: based on several conditions that property gets a value. First we considered creating a desktop plan for this. Then we figured it would be preferrable to have this value set automatically, something that can possibly be accomplished by applying computed content.
Yes, sql-like case stamenent can be implemented as computed content. See below a simple example of a computed content property for Catalog Item entity, serving a purpose of defining a status whether it is reviewed by Data Steward or not based on the description property.
Catalog Item when description is null, custom property shows “PENDING”.
Catalog Item when description is not null, custom property shows “READY”.
Configuration of Catalog Item entity in Metadata Model
Configuration of the computed content entity:
Here is the SQL query:
1select a.id_i , a.parent_id_i, a.from_h , a.path_i , a.type_i , casewhen catalogitem_description isnullthen'PENDING'else'READY'endas status, concat( 'https://mdm-server-one-fyg1u.worker-01-euc1.prod.ataccama.link/runWorkflow?id=WF1:export_all_instance.ewf&inputId=', a.id_i) as urlfrom ( select ci.$ci_id$ as id_i , ci.$ci_id$ as parent_id_i, ci.$ci_from$ as from_h , $path(ci.$ci_path$)$ as path_i , $type()$ as type_i , ci.$ci_name$ as catalogitem_name, ci.$ci_def$ as catalogitem_description, ci.$ci_id$ as catalogitem_gid from $ci$ ci ) as a
Hope this helps! If you have any questions, let me know in the comments below!
Thanks for your example. I'll give it a try to make it fit our usecase. Likely I will have a follow-up question about joining tables, which works different as compared to regular SQL, because in our usecase the case statement will use logic involving several entities. But I will give it a shot myself first.
You’re welcome! And joining multiple entities is also doable. Here is another example where entities are joined together.
1select id_i, parent_id_i, from_h, path_i, type_i, concat('https://ataccama.atlassian.net/jira/secure/CreateIssueDetails!init.jspa?pid=10000&issuetype=10005&labels=AccessRequest&summary=Access%20Request%20for%20',catalogitem_name,'%20from%20',connection_name,'&customfield_10033=',schema_name,'&customfield_10034=',catalogitem_name,'&customfield_10035=',owner,'&customfield_10037=https%3A%2F%2Fone.local.ataccama.pro%2Fcatalog%2Fdata%2FcatalogItem%2F',catalogitem_gid,'%2F&customfield_10038=',connection_name,'&description=Hi%2C%0A%0ACould%20I%20please%20get%20access%20to%20',catalogitem_name,'%20from%20',connection_name,'%3F') as url from (select ci.$ci_id$ as id_i, ci.$ci_id$ as parent_id_i, ci.$ci_from$ as from_h, $path(ci.$ci_path$)$ as path_i, $type()$ as type_i, l.$l_name$ as schema_name, c.$c_name$ as connection_name, p.$p_username$ as owner, ci.$ci_name$ as catalogitem_name, ci.$ci_id$ as catalogitem_gidfrom $ci$ ci leftjoin $l$ l on l.$l_id$ = ci.$ci_pid$ leftjoin $c$ c on c.$c_id$ = ci.connection_ri leftjoin $p$ p on p.$p_id$ = ci.owner_ri) as a
I wanted to apply your input, but I ran into the following. One of the entities that I need in the computed content is an extension of term. When trying to add this it cannot be selected (not visible in the dropdownbox). I can see term itself, but none of the extensions of term that I created. Is that expected behaviour (version 13.9)? Otherwise I'll contact support.
Kind regards,
Albert
I have contacted Support about the last question. I will update this post when I have more clarity.
HI @abir I am trying to implement similar solution. Below are my configurations: When I create referenced object in catalog item and reference computedContent, it gives error that it cannot be referenced. Do I create arbitrary referend object?
Indeed you cannot reference to the computed content directly. It should work by following these two steps:
In the create an ‘embedded object’ property, where the object is your computed content entity.
Create a ‘delegated scalar property’, with ‘Via property’ being the name of the computed content entity (in your case ‘computedContent’) and the ‘Delegate property’ being the name of the property in ‘computedContent’ that you want to apply (so in your case ‘layer').
I forgot to update you regarding the follow-up from Ataccama Support, that investigated why the computed content didn't work for my example.
In short, the issue is that one of the entities that I need in the computed content is an extension of term. When trying to add this entity in the computed content screen it cannot be selected (it is not visible in the dropdownbox).
The feedback I received was that it is considered a bug, being fixed in version 15.4.
Hello, I need further support. I need to join attribute and termInstance but getting error when I bring in attribute of display name from termInstance.
select
a.id_i ,
a.parent_id_i,
a.from_h ,
a.path_i ,
a.type_i ,
case
when a.lop like 'DateOfBirth%' then 'PII'
else ''
end as sensitivity
from
(
select
ci.$ci_id$ as id_i ,
ci.$ci_id$ as parent_id_i,
ci.$ci_from$ as from_h ,
$path(ti.$ci_path$)$ as path_i ,
$type()$ as type_i ,
ti.$ti_dn$ as lop
from
$ci$ ci
inner join $ti$ ti
on ci.$ci_id$ = ti.$ti_pid$
) as a
Also trying different approach but giving different error , support here would be appreciated:
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.