Is there a way to obtain details on triggers in Google Scripts? - triggers

Basically I am aiming to make an easier interface for managing time based triggers that control Google Scripts So far I have not found anything that would allow me to get details on the current triggers, specifically trigger times. There seem to only be a handful of methods supporting trigger management currently.
Documentation:
Class Trigger
Thanks for any suggestions or pointers!

The Apps Script documentation also contains Managing Triggers Programmatically, which is a very promising title.
However, this sums it up:
The only way to programmatically modify an existing trigger is to delete it and then create a new one.
Sometimes we find undocumented APIs by playing with auto-completion, but there don't seem to be any for Triggers at this time.
I tried this little gem, hoping to get logs full of trigger information:
var triggers = ScriptApp.getProjectTriggers();
for (var i in triggers) {
Logger.log(Utilities.jsonStringify(triggers[i]));
}
All I got was "Trigger" repeated ad nauseum. So no help there, the Trigger object is locked down.
I'm surprised that there's no request in the Issue Tracker against the Triggers Component to add APIs to get this additional information, or to support more programmability. You should add one, and report it here so others can star it (cast their vote).

Per #Mogsdad 's suggestion I have submitted a feature request via the Issue Tracker
. Please go and cast your vote for this issue and add any other suggestions for the request. The issue is fairly broad and there may be a lot of detailed information that could be useful if the right API is created. So please add comments in the issue tracker if there are parts you feel need to be addressed in an expansion of the current Trigger API.

Related

Office-Js Word Add In: Detect user change in document/ how to use bindingdatachanged functionality

New Office-js user, I'm working on an advanced find and replaced plug in for efficiency purposes, has anyone had any luck detecting a change to a word document? What I'd ideally love is that whenever text is changed/edited, I could trigger my function. I've been looking into addHandlerAsync(Office.EventType.BindingDataChanged, onBindingDataChanged);, but can't seem to figure out the proper use case for this code to attach it to the word document. I also would need a way of caching the before and after state, which I've seen people mention but again haven't seen any code examples for it.
I'm very aware that this will probably cause issues with that frequent running, so equally if anyone had any experience debouncing/throttling events in office js, or delaying them to set intervals that would equally be awesome.
Many thanks in advance!
Office JavaScript API (OfficeJS) doesn't provide any event for handling document changes. You may vote for the existing request file few days ago, see Office.js Word Document content changes for more information.
You can post or vote for an existing feature request on Tech Community where they are considered when the Office dev team goes through the planning process.

How to get GitHub commit notifications by email after January

I'm part of several teams that depend heavily on GitHub's convenient "send an email every time anyone pushes commits" service, which is slated to disappear in a few weeks. I'm aware that it's been deprecated in favor of a more general WebHooks mechanism, but the docs are not very clear on exactly how one would instantiate the general mechanism to get back what the existing one does.
What is the easiest way to replicate the functionality that's going away?
Beside the original post (Replacing Services with webhooks), you have:
GitHub Actions, still in beta, but which should make it possible to accomplishes this (registration here).
efforts made to look for a webhook-based alternative.
For instance: pyinstaller/pyinstaller issue 3579. But there are no clear answer yet.
Update Feb. 2020: this issue is now closed (GitHub Actions are very much the standard now)
As far as I can tell, GitHub has now restored the previous functionality and even documented it again: https://help.github.com/articles/about-email-notifications-for-pushes-to-your-repository

Custom WorkFlows vs Plug-ins in MS CRM

I used a lot of Plug-in code to implement business logic in CRM but now I've came up with this feature called Custom Workflow Activity.
now i wonder When to use these custom workflows over Plug-ins ?
Code Activities are custom steps which can be inserted into one or many different workflows. Kind of "plugins" but used to be inserted in workflows.
Workflows give you more feedback because they are represented visually in CRM, so non technical people can see the status of a workflow, and the steps which were executed since the start. Workflows are also executed in the Asynchronous service so they run asynchronously, plugins run synchronously, inside the application pool.
So workflows are also better for long running processes.
With that being said, plugins are still helpful when:
You need to have an immediate response, because they are triggered and executed inside CRM's application pool and,
You need to run anything inside the transaction, so they can abort it by raising an exception.
Example: you have an integration with a 3rd party service, where a record can't be created in CRM unless something is validated on the other side. Another example is concurrency: the auto-number plugin is a plugin because it needs to lock the database in the transaction, otherwise multiple concurrent threads could create duplicate IDs.
So, the answer, like always is: It depends. :)
I went deep into the subject myself and found interesting things i want to share,
So here is the complete list of compare :
Plug-in's only fire on data change like updating or creating records but custom workflows take part inside a process ( workflow, dialog, ... )
As a result , workflows not only can be triggered on data change, but on demand at anytime at any point inside their process. As you might have already understood, It is the real flexibility needed for implementing complicated business logic.
Plug-ins won't accept arguments or passed-data,
But custom workflows make it possible by using InArgument properties like below :
[Input("Case")] //label of the field shown in workflow
[ReferenceTarget("incident")] //if using EntityReference, must point the type
public InArgument<EntityReference> yourArg { get; set; } //almost every data type is supported
Workflows can be simply used and manipulated by business users.
Custom Workflows are absolutely reusable. with one register you have a piece of business logic that can be used in several situations.
in some cases you might even happen to write a code which can be used upon many different entities.
So far you know that custom workflow is more reliable than plug-in , but the point that makes a plugin's take over custom workflow is when you are validating data changes and eventually need to revert those changes . of course this is possible in Custom Workflows but it's much more easier to add a plugin than workflow.
and bare in mind that plugins run faster! (as i tested it myself)
However profiling workflows in CRM is still bugged out !
Many of the developers or MS CRM beginners get confused in some scenarios whether to go with Workflows or to go with Plugins, as both can be used and has ability to perform specific task at server side.
Plugins and workflows have some significant differences like limitations in event messages, Triggering points.
You can refer the below link for complete understanding of differences-
https://mscrm16tech.com/.../workflows-vs-plugins-in-ms-crm/

How to use OpenNTF's "Workflow for XPages"?

Any tips on getting started using the "Workflow for XPages" on OpentNTF? The documentation is pretty high-level, and mostly about the sample app. Page 24 is the only one with info about using the simple workflow engine. I'm digging into the EmployeeReview.nsf example database, but could use some pointers?
One of my developers evaluated the workflow stuff over the last couple of days. Unfortunately, I cannot share the documentation that came out as a result of her efforts.
So the only way for you by now is to analyse the parts of the sample application.
Find the Simple Workflow Control und Workflow Action controls in the sample application and take a look at the source code.
You will see that the Simple Workflow Control deals with persons and roles. Roles in the context of workflow are not ACL Roles. They are roles that ere defined in the configuration ( like [Manager] )
So you need to have some kind of configuration in your application that contains a person name an the role this person has in your workflow. If this person is a manager for example, you have also to describe, which other persons he/she is managing.
Then, in your workflow steps you describe, in which wf state a specific person is involved, what is the next step and if any mail is send around.
Once ayou have done a bit of analysis, you will be able to create your own sample application.
I also hope that there will be more documentation around. I will provide more detailed information about how to use the wf controls, but I'm going on holiday in the next days. So I do not have much time left, to put a manual together.
But looking at the source code should help to understand how all the stuff works.

ClearCase: Email Notification on Deliver

At my new company, the CMS is ClearCase. I've worked with Perforce before and it had a nice built-in notification mechanism for the team to keep up-to-date with files that changed in the project. I'm trying to have something equivalent in ClearCase. I would like to know if someone have achieved this before.
Basically, there is three requirements :
Have a way to subscribe to a project. One receives only notification on projects it has subscribed to.
When someone deliver an activity, all the subscribers of the impacted project
receive an email notification about that activity.
The email contain the list of the files affected by this activity. Each modified file has a link that perform a diff that shows what this activity change in this file.
So is someone is aware of a module/extension or any other existing way to put that in place or do I have to do all this manually with trigger and perl scripts ?
Thanks,
Martin
we wanted the same here, so we are using a trigger called ucm_complete_delivery.pl that can be found on CM Crossroads.
You need to apply this trigger to your PVOB (as it's a UCM trigger).
Once you have applied it, you need to define the following Custom Attributes on your UCM component(s):
auto_baseline_email user_1#mydomain.com,user_2#mydomain.com,etc...
It's a bit painful as the mailing list as to be maintained by hand (or you need to use group mail address), but it's better than nothing. :)
Cheers,
Thomas
I am not sure if that already exist, I am sure it is not provided natively with the UCM product.
May be a more specialized forum like CMCrossroad have more informations, but you already put a question there ;)
Anyhow, the simplest way to implement such a notification would be to have a process following new baselines made on a stream.
Each baseline being composed of activities, it would be simple to list those.
Each baseline being easily compared with its previous baseline, it would be simple to list the file versions, and build the appropriate diff.
As for the users following a project, I would suggest as a "subscription mechanism" the list of views of one of the streams of a project: any user having a view on (one of the streams of) that project is potentially interested.
The general implementation principle would be through post-operation triggers, as described in the "Ten best triggers" article
AFAIK, almost all CC operations can have triggers (in Perl, IIRC)
You need to add an email trigger to the deliver operation. Long, long time ago I saw a simple example. But you have to take care of keeping the subscription list and email the appropriate persons.