Forum Discussion

Marvin's avatar
Marvin
Ideator I
7 years ago

Best practice for code in Aras Innovator 11 SP12

I have recently joined a team that uses Aras Innovator 11 SP12, so I'm quite new to this. I see that my predecessors have written some custom C# methods, but I am not happy with the way they are written. The formatting is not great (indentation etc.), which isn't surprising, given the code was probably typed right into the Innovator admin interface. A copy of the code exists in our version control system, but this is most likely just a copy and I am not even sure if it reflects the code currently running on the server. To me this looks like a less than ideal setup, so I am wondering what the recommended practice for custom code is. Ideally, all custom Innovator code would be in our versioning control system and deployed to the Innovator server from a build server. But what's the best way to debug code that is under active development? I would like to use Visual Studio with Resharper etc. for development, with external logging libraries like Serilog etc. etc. Or would it make sense to implement a custom webservice that implements the actual logic and only have very short methods in Innovator that interact with the webservice? How do you guys do this?

7 Replies

  • Hi Marvin,

    5 months down the road, is your question still relevant? I was in the same situation as you 3 years ago and had to come up with my own way of doing this too.

    I am happy to exchange experiences :) 

  • Hello,

    I'm also intersted by both your experiences on this subject!

    Best Regards

  • As I understand it, there's a couple of options.  However, all code customized or otherwise is maintained in the Aras database, with full version history - major rev, generations, etc.   I think this is important because, on the server it's Aras that compiles the server code into executable libraries for IIS.    I don't think deploying code or builds from another server is possible. I may be wrong.

    I've used the Visual Studio add in with success for maintaining code outside of the database, the drawback being it only supports c# - which I prefer, but we have old code in VB, and other methods using JavaScript.

    https://marketplace.visualstudio.com/items?itemName=ArasCorporation.ArasInnovatorVisualStudioMethodPlugin

    I think what makes this a good solution is that it brings in references for all the Aras libraries (IOM, etc.), which give you intellisense in Visual Studio.

    Another option is, if you open the Aras database SSMS, look at the innovator.Method table - this seems to contain all code for server and client methods, along with their history - you can see which is the most recent up to date record by checking the Is_Current field:

    SELECT  id,
    KEYED_NAME,
    METHOD_TYPE,
    MAJOR_REV,
    GENERATION,
    METHOD_CODE FROM innovator.METHOD WHERE IS_CURRENT = 1

    This will show you all the code for methods, omitting the Is_Current will include each methods history.

    • christopher_gillis's avatar
      christopher_gillis
      Community Manager

      These are great points, David. Thank you.

      I wanted to add on to this answer with some suggestions for testing code while it's in development. What our users typically do is run multiple instances (at least 3) of Aras Innovator for the express purpose of developing new functionality.

      • One of these instances serves as the development server. This is a server with limited access that is used for the development of new features. This could include things like adding a new property to an ItemType, writing a new Method and server event, creating a new Form, etc. As these new features are written, they are packaged and exported
      • Next, there's typically a QA server which is used to test the packages from the development server. This is also a limited access server that is just used to test the new features to ensure that there is no loss of functionality or unexpected bugs introduced.
      • Lastly, we have the production server. This is the actual server that your end users will use to interact with your business data. Once a package has been approved on the QA server, it is then imported into production typically during some down, so that it can be tested and validated one last time.

      This is just a general guideline for one possible way to manage your development. There's typically also some practice of regularly backing up the production database and syncing the new data with the development and QA servers.


      Chris

      Christopher Gillis

      Aras Labs Software Engineer

      • Sacha_Bertschi's avatar
        Sacha_Bertschi
        Ideator III

        Thank you David and Christopher.

        I come from a technical background as I was a developer (C#) previously.
        I have been reading the "Aras Development Process Student Guide Version 11".

        If I resume the development process:

        - GIT for version control

        - Visual Studio as the IDE

        - NUnit as the testing framework
        Is this an option? Could I use the test framework from Microsoft? I have been using it with then opensource framework Moq (https://github.com/moq/moq) in the past

        - I don't understand the conversion also, why converting method from C# to AML from the Method project, and then back from AML to C# into the test project? Why the extra step?

        - For conversion also, is it possible to create C# object and use a library to convert them to AML when whe need to provide AML?

        - For debugging using breakpoint, I saw this: //System.Diagnostics.Debugger.Break();
        Is it possible to use the debugger built in Visual Studio? By just clicking on the side of the line wanted?

        I'm trying to understand how to develop with Aras Innovator, thank you for your understanding if some question are really basic.

        And also, is all this different with V12?

        Best Regards,

        Sacha Bertschi