Book a Demo

Author Topic: Unable to create block element with API same as it created on EA interface  (Read 2580 times)

arpit443

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Hello,
When I am creating a block element under a specific package in EA then on UI I can see the type of the block is "Block" and stereotype is "SysML1.5::block", but when I am fetching the same block from the API then I am getting the type as Class not Block.

example/oslc/am/resource/el_{8E93E991-877D-4954-88B2-F427C49F9F77}/?useridentifier={677E75A4-EE37-4baf-A502-EB698ECCB10D}

Also when I am trying to create a Block from API by adding type as Block in payload then I am getting "Block is not a valid type in Sparx EA".

My question are:
1. Is there any way by which we can retrieve the block type from API having type Block not Class ?
2. How can we create a Block from an API same way we are creating it on EA UI so that it will get visible as Block type not Class ?
3. If block has type class only then how can we differentiate them by API response ?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Block doesn't exist as type. EA sortof tricks you and shows the metatype of the stereotype in the GUI (and even in the search window), but in database only the base UML types are allowed.

If you want to create something new using the client API you can pass the fully qualified stereotype to the AddNew() operation.
I'm not sure how that works using the OSLC interface, but I guess passing a Class, and then setting the Stereotype(Ex) should work as well.

Geert