Profile picture for user jordanjt95

Hi Everyone,

Something really strange is happening.

When I'm scripting and testing my script, I'm working on a test environement. When I'm trying to use the script and test it on a another environement (production environement), the script crashes. So I copied the database from the production environement and copied it in my testing environement (meaning the same objects were copied,  also the filters.. everything), the script worked.

Someone can explain why is that ? It would really help ! 

Thank you

by Alexander Cherednichenko
Badge for 'Answermachine' achievement
Posted on Sun, 09/05/2021 - 20:24

Hi,

Suspicious #1 is a filter for the user you use in prod. Check what the filter assigned your user has in prod.

Suspicious #2 is access to groups. Again, if there are some restrictions for the user in prod environment, you'll get issues.

Suspicious #3, related to #2. If your script writes into DB and you do not have permission in prod, you'll get an issue. 

1
by Jordan Tangy
Badge for 'Question Solver' achievement
Author
Posted on Wed, 09/08/2021 - 00:48

In reply to by BPS

Hi,

First thank you for your quick response.

The filters used are the same, so it can't be the issue.

About the suspicious #2 no probem about that neither.

About #3, my script does not write into DB.

I'll give you more specifics about my issue and the error.

function process_sheetBuilder(model,sheet_name,row,col){
    
    var proc_list = model[0].ObjDefList();
    
    for(var i = 0 ; i < proc_list.length ; i++){
        var currObj = proc_list[i];
        
        var EPCfromObj = currObj.AssignedModels(Constants.MT_EEPC);
        var FADfromObj = currObj.AssignedModels(Constants.MT_FUNC_ALLOC_DGM);

In test environment , the "currObj" variable is well defined , however in prod environement, an error message pops and says something like "cannot find assigned model of undefined object (currObj) " , meaning that there is a problem with the "proc_list" array. So instead of using the "ObjDefList" function, I tried to use the "ObjOccList" function, and then it worked, but it crashes elsewhere in the script, where I'm using  Definitions and not occurences, meaning that I should rewrite the whole script using occurences (and it implies changing other functions , which is a real hassle).

If you have a clue on what's going on, I'll appreciate to have some advices.

Thank you

1
by Veronika Ellermann
Badge for 'Fan' achievement
Posted on Mon, 09/06/2021 - 10:04

Hi Jordan,

Do you receive any error message? If so, what does it say?

Best,

Veronika

0
by Jordan Tangy
Badge for 'Question Solver' achievement
Author
Posted on Wed, 09/08/2021 - 00:53

In reply to by Vee_ARIS

Hi Veronika , 

Here is the piece of code where I have a problem and then I'm explaining about the error message that I got.

function process_sheetBuilder(model,sheet_name,row,col){
    
    var proc_list = model[0].ObjDefList();
    
    for(var i = 0 ; i < proc_list.length ; i++){
        var currObj = proc_list[i];
        
        var EPCfromObj = currObj.AssignedModels(Constants.MT_EEPC);
        var FADfromObj = currObj.AssignedModels(Constants.MT_FUNC_ALLOC_DGM);

In test environment , the "currObj" variable is well defined , however in prod environement, an error message pops and says something like "cannot find assigned model of undefined object (currObj) " , meaning that there is a problem with the "proc_list" array. So instead of using the "ObjDefList" function, I tried to use the "ObjOccList" function, and then it worked, but it crashes elsewhere in the script, where I'm using  definitions and not occurences related functions, meaning that I should rewrite the whole script using occurences related functions (and it implies changing other functions , which is a real hassle).

 

Let me know please if you think you know where the problem could be.

Thank you

1

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • PacMan

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock