Start workflow based on the validation result
As default, the workflow can start based on the status of asset. In my case, I want to start workflow based on both status and validation result of an asset. For example below, I just want to show the Test Approval Workflow for DQ Rule button when the status is “Candidate” and Validation result is True. Do you have any suggestion for that? Thank you
khanhdung_dao
Posted 3 years ago · Edited 1 year ago·Last reply 3 years ago
6 comments
harryhazelwood
·3 years ago · EditedHey -
Yep - absolutely another way to go around it. As above it would depend on exactly what you’re happy doing for your users status wise.
For your debugging error - essentially you have used a variable/parameter ‘comment’ in Script5 which does not exist.
Would be worth looking at the relevant script task - and pasting it here if
harryhazelwood
·3 years ago · EditedHey -
Yep - absolutely another way to go around it. As above it would depend on exactly what you’re happy doing for your users status wise.
For your debugging error - essentially you have used a variable/parameter ‘comment’ in Script5 which does not exist.
Would be worth looking at the relevant script task - and pasting it here if
khanhdung_dao
OP3 years ago · EditedThank you so much, I fixed my error.
I have another question how can I add the current date value to the attribute effective start date attribute? I use the now() function but I got the error:
“No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.now() is applicable for argument types: () values: []”
harryhazelwood
·3 years ago · EditedHey,
There’s some checks you could create in your workflow to only allow it to work if the status & validation result are what you want it to be. If they’re not equal to that then you can throw an error for the user on why it won’t run.
If you want to not actually even display the workflow button - you likely need to utilise the workflow assignment rules. You’re entirely correct that you can set it to work on certain statuses, but not validation rule results.
My suggestion would be to create a workflow that moves the asset to a different domain if validation result == True at the point of checking. That will allow you to set the assignment to run the workflow on that domain only.
Alternatively - you could change the status of the asset when validation == True (Status == Candidate - Validated?). That would allow you to use that status on the assignment rules and keep them under one domain.
Not a clean workaround - but hopefully will help.
harryhazelwood
·3 years ago · EditedHey,
There’s some checks you could create in your workflow to only allow it to work if the status & validation result are what you want it to be. If they’re not equal to that then you can throw an error for the user on why it won’t run.
If you want to not actually even display the workflow button - you likely need to utilise the workflow assignment rules. You’re entirely correct that you can set it to work on certain statuses, but not validation rule results.
My suggestion would be to create a workflow that moves the asset to a different domain if validation result == True at the point of checking. That will allow you to set the assignment to run the workflow on that domain only.
Alternatively - you could change the status of the asset when validation == True (Status == Candidate - Validated?). That would allow you to use that status on the assignment rules and keep them under one domain.
Not a clean workaround - but hopefully will help.
khanhdung_dao
OP3 years ago · EditedThank you for your suggestion.
I have another idea, if the validation result of an asset is False, I will set the status of that is “Rejected” and notify to the user. My code and my diagram is attached below. I can upload the workflow to collibra but I got the error “workflowNotStarted” - “groovy.lang.MissingPropertyException: No such property: comment for class: Script5”.
Do you have any advice for debugging the workflow?