cancel
Showing results for 
Search instead for 
Did you mean: 

Script Won't Execute

Former Member
0 Kudos

Hey all. Having a bit of a weird one here. Maybe someone can see the error in my logic.

I have a job that is supposed to search out a given set of users who's accounts are on the brink of expiration and notify them and their managers of this impending action. To do this, my job has 3 passes but the pass that's giving me issues is the final, and most important, pass; the pass that actually sends the notification.

The pass is a "To Generic" pass and has a script in the "Next data entry" field. This script takes in all the necessary information and then uses uSendSMTPMessage to do the work. Problem is, my script isn't even executing. I put a couple uWarning lines in there so I would see something, ANYTHING, if my script is running and that's not happening. Here are screenshots of my source and destination tabs as well as the results of executing the SQL in Toad. In Toad, the SQL returns my test user so I know the query isn't the problem.

Lastly, here's the script itself:


// Main function: z_notificationsUserManager

// B. Bollin, May 2014

function z_notificationsUserManager(Par){

                //Example calling DSE internal function

                //uStop("Terminated by user");

                uWarning("z_notificationsUserManager - I am executing.");

                var userNameTemp = Par.get("DISPLAYNAME");

                var expirationDate = Par.get("EXPIRATION_DATE");

                var managerNameTemp = Par.get("MANAGER");

                var managerEmail = Par.get("MANAGER_EMAIL");

                var userEmail = Par.get("USER_EMAIL");

                var managerNameArray = managerNameTemp.split(", ");

                var userNameArray = userNameTemp.split(", ");

                var managerFirstName = managerNameArray[1];

                var managerLastName = managerNameArray[0];

                var userFirstName = userNameArray[1];

                var userLastName = userNameArray[0];

                var messageFrom = "%$rep.MAIL_ORIGINATOR%";

                var recipients = managerEmail + "cc:" + userEmail;

                var messageTitle = "Expiring Contractor - DO NOT REPLY";

                var testMessage = "Test";

                var SMTPHost = "%$rep.MAIL_SMTP_HOST%";

                var contentType = 0;

                var SMTPPort = "%$rep.MAIL_SMTP_PORT%";

                uWarning("z_notificationsUserManager - Value of recipients = " + recipients);

                uSendSMTPMessage(messageFrom, recipients, messageTitle, testMessage, SMTPHost, contentType, SMTPPort);

                return "";

}

I know the pass itself is executing because the job log shows results for that pass, even if the "Status" and "Entries" sections are empty. Can anyone see my error? Thanks in advance for your time.

-Brandon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

OK, this is the weirdest answer ever but this is how I got this fixed. I was using Toad to insert values into my temporary table so that my test user would have the NOTIFY value equal YES. Apparently, using something other than IDM to update that table causes IDM to treat the table like poison. I went back to my pass that creates the table in the first place and rigged it to put a YES value in that NOTIFY slot for me so that I didn't need to use Toad to insert my required values. Now, it's working. Seriously IDM? How does IDM even know that a given table was updated using a tool other than IDM? Really stupid if you ask me but, at least it's working now.

terovirta
Active Contributor
0 Kudos

Hi Brandon,

how does the table get created? Does the IdM runtime user get permissions to the table if it's not created by IdM's to/from-database passes?

regards, Tero

Former Member
0 Kudos

Perhaps you didn't use commit after inserting the value? Also what Tero said.

Br,

Chris

Former Member
0 Kudos

The table is created via a "From Database" pass. That's a good question about the permissions. If I update the table using Toad, does that remove IDM's rights to access the table? Maybe. I'll have to look into that one. That would, however, seem to be the case.

Former Member
0 Kudos

The values are being committed.

Former Member
0 Kudos

Inserting data should not remove any rights from the table. But you can have two tables with the same name but owned different users, one created by the _rt and another created by _oper (done this several times myself). Check that your Toad configuration is using the _rt user as well. If it's using Oper, admin or something else then you need to prefix the table with mxmc_rt.<name> when inserting data to it in Toad.

Former Member
0 Kudos

I thought of that. When referring to the tables in Toad, I'm using MXMC_RT.<table name> to avoid that exact issue.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Brandon,

      Not exactly sure whats the problem. why don't you remove all other statements from the script and just receive the parameters in the script and do a uWarning of those parameters or may be a single uWarning so that you will come to know if the problem is of the script or of the query?

Also, does all other scripts work fine?

Regards,

Mohamed Fazil

Former Member
0 Kudos

All the other scripts in the other passes of the job work fine. Additionally, I just ran the job and commented out all the lines except line 6 and 27. The only thing the script should do is issue that warning and it's not doing that. I tried creating a brand new "To Generic" pass and doing everything the exact same and running the script from that new pass, same results.

What's even more puzzling, when I take the script out of the "Next data entry" field and place it in the "Open destination" field, again with only that one warning line uncommented, it executes. The problem is not the script. It's something to do with the pass. It simply isn't processing the script in the "Next data entry" field.