Better Periodic Review/Certification/Action
We’re looking to implement a more periodic review of assets, but have found that the one in the Marketplace is not ideal for our environment. Specifically, the persistence of a task that is actually not to be performed a) may confuse our users (seriously!), and b) makes task management and visibility more difficult.
Our idea is to create a complex relation type that can assigned to any asset type that requires a periodic evaluation of some sort. The complex relation would be one of two forms:
- a date-centric action, which would include
- the asset itself,
- enumerated action verbs like “review”, “renegotiate”, or “license”
- enumerated qualification like “on”, “before”, “after”
- an optional period for “before”, “after” qualifications
- a period-centric action, which would include
- the asset itself,
- an enumerated action verbs like “review”, “renegotiate”, or “license”
- a time period, which might be enumerated, or split into a numeric quantity and an enumerated period type (“Years”, “Months”, “Weeks”)
Ideally, a workflow runs every day to check for assets having one of these two complex relations, and fires the appropriate workflow on the asset based on the “action verb” if the time period is met and the workflow isn’t already running. On completion of the workflow, the complex relation is modified or deleted.
What is the best way to have this monitoring workflow execute on a daily basis? Our preferences would include:
- Fault-tolerance, such that if something fails, it will just execute again the following day
- Non-time-creep, so that it’s execution time does not slowly advance every time it runs
- Minimal external dependencies, though we could — if necessary — have an external system call the Workflow through the API
Does anyone have ideas on how this might be improved?
Tom Friesen
Posted 5 years ago · Edited 2 years ago·Last reply 5 years ago
5 comments
S Benson
·5 years ago · EditedThis solution also satisfies 50% of one of my requirements. I need the second workflow to review an asset, for example Policy, and see if it is going to expire within the next 30 days. If so, send an email to the owner of the policy. I cant figure out how to do the required math… Help, please.
Scott
arvindsingh
·5 years ago · Edited@scott.benson
I assume you are storing this date (expiry date) as an attribute on asset, then you can leverage attributeApi to get its value.
currentDate = new Date()
30dayDate = currentDate.plus(30) //add 30 days to current date
def expiryTime =30dayDate.getTime() //convert 30th day to time value
expiryDate = attributeApi.findAttributes(FindAttributesRequest.builder()
.assetId(replaceWithAssetId)
.typeIds([attributeTypeExpiryDate])
.build()
).getResults()
If (expiryDate) {
existingExpiryDate = expiryDate.first().getValue()
if(existingExpiryDate < expiryTime){
do your thing - send email
}
} else {
print(“expiry date is not valid”)
}
I have not tested it, but date/time logic will work. Thanks!
S Benson
·5 years ago · EditedThank you very much !! I will pass this on to my developers.
arthurburkhardt
·5 years ago · EditedSo you would have a workflow automatically executing let’s say daily, which would read all your configurations (either attributes on an asset or complex relations) and whenever time’s up, it would automatically start another workflow for the review.
It would be fast, idempotent and reliable. Does that work for you?
Tom Friesen
OP5 years ago · EditedPerfect. I figured there had to be a way to do this, but overlooked the TimerStartEvent.
Thanks, Arthur!