10 Messages
Tracking Asset Attributes Changed
We have an interest in tracking changes to attribute fields made to assets and then notifying stakeholders through email tasks. To this end, we intend to develop a workflow triggered by the Start Event “Asset Attribute Changed.”
Given that there is no form for a start user to utilize, and we will lock down the workflow only for use by those with sysadmin permissions, I am assuming when developing this workflow that I can leave form properties in the start event blank when working in Eclipse IDE. This may or may not be an incorrect assumption.
With that assumption intact, I’d like to get to a second, script task wherein it seems we should be utilizing the interface NamedDescribedWorkflowStartEventType to set variables for distribution through a later mail task. The modifier WorkflowStartEventType that retrieves the event type may or may not be of much interest, given that we have yet to see what the getDescription() method actually spits out: a “human-readable” description that may be sufficiently encompassing our needs.
The following is my attempt thus far at the body of the script task “Main config:”
import com.collibra.dgc.core.api.model.workflow.NamedDescribedWorkflowStartEventType
String startEventName = WorkflowStartEventType getEventType(getName());
String startEventDescription = WorkflowStartEventType getEventType(getDescription());
execution.setVariable("name", startEventName);
execution.setVariable("description", startEventDescription);
Now, I may be wildly off base. If any of you would have suggestions as to how to improve this script task, please, I would greatly appreciate it.
So far, I am receiving the following chastisement from the Console:
No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getName() is applicable for argument types: () values: []
Given that we could apply different workflows in this model to different domains piecemeal, it is my hope that custom text in a subsequent mail task could provide appropriate context for the content of these variables. Thanks.
keeganshirel
5 Messages
2 years ago
Hi @tyler.bass.tmrhq2.com,
When your workflow is triggered by a start event, you can use the workflow beans to get information about the event. I set a workflow to trigger on asset attribute changed and then changed the description of an asset.
Will yield something like
From here you can get the asset this attribute belongs to then users assigned to responsibilities, etc. If you just want to notify users of a given change, also consider if the built in email notifications could meet your use case.
7
arthurburkhardt
1.2K Messages
2 years ago
Indeed @tyler.bass.tmrhq2.com , the notification workflow is great to get daily notification about all changes.
Here’s a code snippet that does something very close to what you’re looking for. It tracks responsibilities instead of attributes, but it’s the same logic.
https://datacitizens.collibra.com/forum/t/how-to-retrieve-in-a-workwflow-a-user-which-had-been-role-granted/1104/5?u=arthur.burkhardt
Keep in mind that performance is probably going to be horrible though, because the workflow would trigger EVERY SINGLE TIME an attribute is modified.
The daily notification is probably a better approach.
0
SeanPyle
66 Messages
•
1.5K Points
2 years ago
@tyler.bass.tmrhq2.com , here is some code that worked for me to get the label and description. I used the FindWorkflowDefinitionsRequest to isolate the current workflow and a business item workflow bean. Cheers!
4
shaileshkumar
11 Messages
2 years ago
@arthur.burkhardt, in the example that you shared I can see that it was working fine with both Access granted and revoked. I am just wondering if I can use similar approach to keep track of the relations that have been deleted?
0
0
manrichkotze
21 Messages
2 years ago
Hi guys, coming in from the side here. We are also in need of a workflow that will showcase all assets where responsibilities was adjusted and it sends an email to a specific person to review. This is linked to our ownership model, we would like to see what assets have been updated responsibilities changes. Is there something like this?
@arthur.burkhardt
3
0
prasanthiramaswamy
11 Messages
•
200 Points
3 months ago
May I please check with you what class is to be imported for this:
def domainValue2Name = domainApi.getDomain(domainValue2).getName()
Thank you!
1
0