Git Product home page Git Product logo

Comments (16)

herve91 avatar herve91 commented on September 26, 2024

Hi Javier,

In fact, you do not need to adapt your ServiceNow relationships to my plugin, but rather adapt my plugin to your ServiceNow database.

My plugin ini file indicates how to convert ServiceNow relationships to Archi relationships.

As for elements, you may configure general parameter, and relationship specific mappings.

Let's consider the following lines:

archi.relations.id = sys_id
archi.relations.source = child
archi.relations.target = parent

For all relationships, the plugin will use the "sys_id" field of the ServiceNow relationship as the Archi relationship ID, the ServiceNow "child" field as the Archi relationship's source, and "parent" field as target.

Now, let's consider the following lines:

archi.relations.a8aab4c26f395900f0721cef8d3ee44a.mapping = AssignmentRelationship
archi.relations.a8aab4c26f395900f0721cef8d3ee44a.name = "Is hosted on"
archi.relations.a8aab4c26f395900f0721cef8d3ee44a.source = parent
archi.relations.a8aab4c26f395900f0721cef8d3ee44a.target = child

This indicates that the "a8aab4c26f395900f0721cef8d3ee44a" ServiceNow relationships will be mapped in Archi as AssignmentRelationships, that the Archi relationship's name will be "Is hosted on", and that for those specific relationships, the order of source and target are inverted from what was specified in the global parameters.

The "parent" and "child" fileds in serviceNow are the ServiceNow IDs of the elements. So the relationships will be imported if, and only if, your elements have got the same ID between ServiceNow and Archi.

So if you imported your elements with the plugin, then the relationships can be imported.
If you created your elements manually, you cannot import the relationships.

As stated previously, I did not use my plugin for a while now. Archi and ServiceNow evolved since I wrote my plugin, so my plugin may need to be adapted for relationships as it needed to be adapted for relationships.

So if you fail to do what you wish, please do not hesitate to tell me and I will have a closer look.

Best regards
Hervé

from snow-import-plugin.

javichu1991 avatar javichu1991 commented on September 26, 2024

Thank you very much for the explanation.

I'm trying to get access to a Service Now that contains the relationships to see how they are configured and try to pass those relationships to Archi.

When I have access and see how the relationships are defined, I tell you.

As for the Archi id, surely, for the Service Now objects, as you comment, we will use the Service Now IDs to be able to use the relationships later.

Thanks and best regards,
Javier.

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

you're welcome.

from snow-import-plugin.

javichu1991 avatar javichu1991 commented on September 26, 2024

Hello Herve,
Reviewing the code, when you are evaluating whether the relationships exist, on line 499 it is written:

IArchimateElement target = (IArchimateElement) ArchimateModelUtils.getObjectByID (model, getJsonField (jsonNode, this.iniProperties.getProperty ("archi.relations.dest")));

I understand that this sentence collects each of the target of each relationship, but it catches my attention "archi.relations.dest" should not it be "archi.relations.target"? In the file ServiceNow.ini it is declared as "archi.relations.target = parent"

Also, I believe that the "Update" counter is always 0, because it is not updated in any of the steps in the relations part.

this.updated = this.totalUpdated = 0; --line 480
this.logger.info("Imported " + (this.created+this.updated) + " relations from "+count+" relations received from ServiceNow ("+this.created + " created + " + this.updated + " updated)."); --line 526

Thanks and best regards,
Javier.

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

How could I missed this :-(

Thanks a lot for pointing me this issue. I just release the version 1.2.2. which replaced "archi.relations.dest" by "archi.relations.target".

Please let me know if it works better ...

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

By the way, for your information, I will probably start a version 2 of the plugin which will be much more flexible. I was thinking of something like showing ServiceNow content, and allow the user to find and select the elements and relationships he wishes to download and then find a way to automatically match ServiceNow components with Archi components.

So please do not hesitate to send me your requirement or any ideas on how you would like things to work as nothing has started yet ... and you'll have to be patient because I already planned updates on my other plugins and I only have got 2 hands :-)

from snow-import-plugin.

javichu1991 avatar javichu1991 commented on September 26, 2024

Thanks for making the change.

If I find another problem, I'll tell you. By the way, have you seen the problem of the variable "update" in the relations part? I think it's always 0. In the elements part, this variable it's fine.

At the moment, as I indicated a few days ago, I am waiting to have access to the BD to know how the relationships are configured. It is the only part I have left, since my project consists solely of transferring the elements and relationships of Service Now to Archi. As soon as I have news, I will try to pass the relationships and if I have any problems I will write to you in case you can help me.

Thank you very much,
Javier.

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

I'm sorry but at this stage, the plugin is able to create relationships, not update them ...

I've got a todo regarding this point line 525
// TODO: verify what is done when relation already exists. Eventually, create method createOrReplaceArchiRelation

from snow-import-plugin.

javichu1991 avatar javichu1991 commented on September 26, 2024

Hello again Herve,

I'm almost finishing the project and all thanks to your plugin.
These days I have been doing tests and I have detected some things. Can you help me?

1 - When importing the relations, I put it in the following way:
archi.relations.6afd799338a02000c18673032c71b87b.name = "Runs"
archi.relations.6afd799338a02000c18673032c71b87b.mapping = AssignmentRelationship

But when I see the name of the relationship, it appears empty. Why?
"Runs" should appear, right?

image

2 - I have several elements with properties that in Service Now are of type "Reference". Is there any way that archi shows the value of the field and not the Service Now reference?

For example, the "Owner" field is a reference type field in Service Now. The name of the owner should appear in Archi but the field reference appears instead.

image

Thank you very much and greetings,
Javier

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

Hi Javier,

  1. yes it should, but I must admit that it doesn't ... In fact, I've got a bug in my code ...
    Nest release will sove this point.

  2. my plugin voluntarily ask ServiceNow to not follow the reference IDs (I add "?sysparm_exclude_reference_link=true" in the webservice request), else the volume of data will be very big (My ServiceNow database has got more than 30000 CIs in a single table and getting only few properties already takes more than 1 hour).

The issue here is that once I've got the ID (like the propietario property), I've lost the table name that contains that ID. So I do not have the ability to retreive the name of the owner with a second request.

So what I suggest is that I will add a flag somewhere that will allow to switch on or switch off the following of the reference ID. When it is switched off, il will reduce the volume of data transfered and therefore accelerate the download, and when it is switched on, I will allow to specify the field of the referenced link to consider. Something like:

archi.relations.propietario = owner#name

which would take the "name" field of the "owner" property.

I believe this would suits your need.

  1. As I already told you, this plugin is the first I wrote and my knowledge of Archi, of Java and of the Eclipse framework was very little. I grew up on these and I am myself in the need of re-use my ServiceNow plugin, so I will work back on it to enhence its functionalities. So if you've got some ideas on what the plugin should do, please do not hesitate to tell me.

What I'm thinking of (with no preference order - yet):

  • create a graphical interface to generate the configuration file (as I did on my form plugin)
  • add filters to restrict the CIs or relations to download
  • allow to replace relationships when then already exist as I do on elements (today, if the plugin runs twice,the relationships are created twice)
  • create a graphical interface which allows to browse ServiceNow and interactively download elements or relationships (without the need to create a configuration file)
  • allow my batch plugin to pilot the ServiceNow plugin as it does with my database plugin
  • allow jArchi to pilot my ServiceNow plugin
  • ...

Please do not hesitate to complete the list :)

Best regards
Hervé

from snow-import-plugin.

javichu1991 avatar javichu1991 commented on September 26, 2024

Thank you very much for the quick response. I will investigate what more options you can include in your add-on.

Regarding point 2, will it be available in a new version?
Would it be possible for you to give me a quick solution for the "references"?

I need to deliver a proof of the Service Now - Archi integration this week and this is a big problem for us.

As you said, I show you an example of my cmdb_ci_server table:

With true (https://sarebqa.service-now.com//api/now/table/cmdb_ci_server?sysparm_exclude_reference_link=true):

image

With false (https://sarebqa.service-now.com//api/now/table/cmdb_ci_server?sysparm_exclude_reference_link=false ):

image

As you see, the "owned by" field is a reference field and shows that its value is in the sys_user table. I also have other reference fields like "Assigned to". Is it possible that you give me a solution with your plugin for my last problem? ?

Thank you very much again for the collaboration.

Greetings,
Javier.

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

As you see, the information is not directly available in the json result:

  • with sysparm_exclude_reference_link set, then you just have got an ID
  • with sysparm_exclude_reference_link unset, then you have got the ID and a link you can follow

So I need to update my code to allow th switch the sysparm parameter on and off, then I need to make a separate call to the link provided by ServiceNow, and finally I need to parse the result to get a specific field.

I started to develop the functionnality, but this will take some time.

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

Hi Javier,

Just to keep you informed ... I'm working very hard for you ...

As of today in my dev version, you can specify a property like
archi.elements.cmdb_ci_aix_server.property.processor = processor#display_name

The plugin will automatically switch the request to "sysparm_exclude_reference_link=false" and will get the "display_name" from the link fiven in the "processor" field.

I'm currently implementing the possibility to follow several reference links like
archi.elements.cmdb_ci_aix_server.property.pvus_per_core = processor#processor_mapping#pvus_per_core

After that, I need to fix few issues on the relations side.

So you won't have the functionality this week I'm afraid.

Best regards
Hervé

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

Dear Javier,

I've been working very hard to provide your the ability to follow links. the version 1.3 allows this.

Please pay attention, to increase this delivery speed; I've been obliged to change few things in the ini file. To ease the migration between the old and new syntax, I added a lot of details in the comments.

Please do not hesitate to drop me a line should you require some help.

Best regards
Hervé

from snow-import-plugin.

javichu1991 avatar javichu1991 commented on September 26, 2024

Dear Hervé

 After change the properties of the ini file, I test the new release and it's work quite well. 

Thank you very much

Best regards,
Javier.

from snow-import-plugin.

herve91 avatar herve91 commented on September 26, 2024

You're welcome.

I close this case. Please do not hesitate to open a new one if required ...

And if you find a way to determine the operational status of ServiceNow relations, I'm interested to know.

Best regards
Hervé

from snow-import-plugin.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.