It's all about the answers!

Ask a question

DNG 6.0.5 Extensions/ java script hooks ?


Rafael Rodriguez Montes (23013126247) | asked Jun 30 '19, 3:59 p.m.

 Hello, 

I would like to sync another system after an user updates the requirement artifact, is there any way similar like in ccm, where you can hook java scripts calculated once the artifact is updated? or it should be through an extension developed, could you help me with an example. 

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Jul 01 '19, 10:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 01 '19, 10:35 a.m.

 These are the available APIS for DNG: 


This is client API - see the version you need. 

DNG and RQM do not provide an SDK and you can not create custom operation behavior (as far as I know).

Rafael Rodriguez Montes selected this answer as the correct answer

Comments
Rafael Rodriguez Montes commented Jul 01 '19, 11:34 a.m.

so before getting into the APIs for DNG, there is no way to create or hook something base on the action save or modify on the DNG artifacts? like developing an extension in DNG where we can hook an script with x action when the user saves the artifact?

 


Ralph Schoon commented Jul 01 '19, 12:20 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

That is correct as far as I am aware. 


Rafael Rodriguez Montes commented Jul 01 '19, 7:09 p.m.

Thank you Ralph!

in terms of developing an extension, may exist a possibility on triggering actions base on the actions save?  or either way there no way?
Thank you. 


Ralph Schoon commented Jul 02 '19, 12:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No.  


As far as I know the only ones that can write something that is acting similar to a save participant/follow up action or a precondition is the DOORS Next Generation development team with access to the full product source.

I can not really tell how far you can go using the JavaScript Client API but as far as I am concerned I don't see how you could use that to drive integrations or preconditions/follow up actions.

This is the last repetition of my opinion in this thread.

One other answer



permanent link
Davyd Norris (2.2k217) | answered Jul 02 '19, 1:29 a.m.
edited Jul 02 '19, 1:40 a.m.
The DOORS Next Gen RM Extension API provides a few things that you could use, however these are limited to the Client side so I'm not sure they are what you want.

The API has a set of events, including the RM.Event.ARTIFACT_SAVED event, which will be triggered after an artefact is saved. The subscribe function lets you register a callback that is triggered on the registered event, and is supplied a list of affected artefacts, as below:

function onSelection(artifactArray) {
  <do something with the list of artefacts and your external system>
}

RM.Event.subscribe(RM.Event.ARTIFACT_SAVED, onSelection);

You would need to create some JavaScript that sets this up, and get it to load when the user is working. Most commonly this is done via a widget on the user's side dashboard - I can't think of any other way to automatically load this in the background (the user would have to explicitly set this up)

Comments
Ralph Schoon commented Jul 02 '19, 1:39 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Davyd is a guru in JavaScript compared to my 'skills' which are pretty lackluster. 

The client integration he mentions is the best can do as far as discussions went, that I attended. There are exampes in the client API. All use the dashboard mini.

Requsts that go deeper are apparently not possible today. 


1
Davyd Norris commented Jul 02 '19, 7:58 p.m.
LOL thanks @Ralph - don't know about guru though. It's more by necessity than by choice!

I think this is something the IBM devs need to look at a lot more as the SaaS offerings are really becoming popular. Apparently our local IoT Exchange conference has only one registration that is using CLM on prem - everybody else is using the SaaS 'on Cloud' offerings and loving them.

As a business partner with clients all across Australia and New Zealand it has also meant I can work with my clients without getting on a plane every time, and I can focus on the engineering problems with them instead of the software admin and maintenance.

On the down side, it does mean I have had to dig a lot deeper into the JavaScript client API (or undocumented API) than I care to, and I have also had to do some really gross kludges to get the result I need. I'd love to sit down with some of the devs and workshop the client API for the whole toolset - a few small enhancements would make a huge difference

Rafael Rodriguez Montes commented Jul 07 '19, 8:16 a.m.

Thanks @Ralph and @Davyd for your comments, 

I wonder if we could access to the custom attributes of the artifact? using  widget?nks
Thanks


Davyd Norris commented Jul 07 '19, 7:26 p.m. | edited Jul 07 '19, 7:40 p.m.

Yes you can - it's pretty much exactly the same way for customised attributes as for built in ones (just use getAttribute('My Custom Attribute') ), and yes the widget is the default approach that the API was built for.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.