Admiral
Admiral
5073 views

Can I schedule a transition to run by itself at a particular time?

I have a date/time field that is calculated in every transition (Now minus the start date/time). I will run a transition that updates this field in a report in which all open items are checked (a mass-edit) at least twice a day, so that when a user opens an item, the date/time field is fairly current. Is there a way that I can accomplish the same task automatically?
0 Likes
14 Replies
Fleet Admiral
Fleet Admiral

It sounds like the field is the item's "age". Does this field need to always be correct (even if no-one is is viewing the item)? How about if the field was calculated each time the item was viewed? A report can use a calculated column to show the item's age, and a form can do a calculation to show age. A custom form can also use the new JSON library to update the item each time it's viewed (even if the user doesn't initiate a transition). It just amounts to a lot of updating and change history. I can't help but think that a field is the wrong solution for the results of this calculation.
0 Likes
Admiral
Admiral

For the Closed state, I want the age recorded and not updatable. I've used a calc column for reports. This is not for reports, but for the user to see and be reminded of the item's age. The JSON idea sounds good for all custom forms except Closed. Support had suggested a notification that triggers a transition. Perhaps some escalation that just detects 7am and noon each day can do the trick, if I can figure out how to set that up.
0 Likes
Micro Focus Expert
Micro Focus Expert

Hi Phil,

an alternative to the suggestions all ready provided by Support and Paul would be an embedded report. It is quite quick and easy way if you don't mind hthat it looks like an embedded report widget on your forms -see attachment. This will shows the exact age whenever your user opens an item. I think this is what you are after? See attachment for how these 3 steps should look like.

(1) Create a simple report in Composer with calculation field

(2) Add embedded report widget to your forms

(3) This will display on forms

Also of note is that 11.4 which is currently scheduled for the end of May will have a new Scheduler feature. This may be helpful.

Jackie
Absent Member.
Absent Member.

I have about 5 scripts that I run from Windows Task Scheduler. 4 run once a day and 1 runs every 20 minutes.

The scripts do things like: Expire record flags in Aux tables that have time/date releated expirations.
Generate Test Records for Testing Projects.
Generate Emails from Project Criteria
Double check automated Notification Transitions that don't always work.


The scripts are sbm appscript that run in URL context. URL Context scripts seem to be the only way you can kick of a program outside of the Notification Engine.
0 Likes
Micro Focus Contributor
Micro Focus Contributor

FYI, the upcoming SBM 11.4 release has a scheduler in it with the ability to execute ModScripts directly. Also, ModScript has the ability to execute actual transitions, not just Update.
0 Likes
Absent Member.
Absent Member.

There's always the semi-verboten option of running a non-SBM script that modifies the SQL backend directly every "X" hours.
0 Likes
Fleet Admiral
Fleet Admiral

To avoid all the confusion and complexity of background scripts and transitions and database updates, how about if AGE was calculated and displayed anywhere it could be viewed? That's basically in reports and on forms.
0 Likes
Admiral
Admiral

I'm not sure what you mean. Although I've hidden the field at my manager's request for now, the field is calculated in each transition. However, it can't be calculated simply by opening a form in a state, can it? Wouldn't that be by form action? Actually, can a form action run a transition from any to any that runs the calculation, upon form load? I think not. And similarly, in reports, the AGE would show the last value calculated, at the last modified date, not the current date.
0 Likes
Micro Focus Contributor
Micro Focus Contributor

What Paul is referring to is in Listing reports. You can add a calculated column, and that column can be "now - Submit Date". This will display the elapsed time for the open item. The idea is to get the age dynamically when the report runs, rather than trying to store it in a field.
Admiral
Admiral

Paul mentioned forms. I'm thinking I'd imbed a report in the form, and the report's calc column would display, without a report title showing?
0 Likes
Micro Focus Contributor
Micro Focus Contributor

I have a colleague who is better with forms looking into calculating age on a non-transition form. You could do it with a report, but I'd think this should be possible with form actions or something.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.