x
login Signup

Detecting missing job logs in email notifiers

On my EC4.2.1 system, I have a notifier that includes links to the logs for individual job steps. It is working well and my community likes the reports because it gives them detailed information for the individual steps that run test cases.

We have some procedures that aggregate the results of more than subprocedure. However, that process doesn't create a log and I am trying to figure out how to omit a job link if the file is not present. I would prefer a solution where I could peek at the log and then display the log if it exists. Additionally, it seems jobStep.logFileName is the best candidate.

What do you recommend?

avatar image By marcoman 2.2k asked May 16, 2013 at 07:08 AM
more ▼
(comments are locked)
10|750 characters needed characters left

1 answer: sort voted first

Notifiers don't have access to the workspace. The body is evaluated by the Commander server (and $[] properties are expanded) before it's sent to the target user(s). You can run a step that does have access to the workspace and compose your email beforehand, storing the contents in a property which is referenced by your notifier (or you can use the sendEmail API). This step can check for log file existence since it's running in the job's workspace.

If you're looking for log files, I'd suggest setting the "log file name" for the steps if possible so you know exactly what to look for when composing the email. Be careful though -- if you're using parallelized subprocedures, you'll have to embed something in the log file names to guarantee they are unique within the job. For example, if you passed a parameter called platform to each subprocedure call, embed $[platform] in the log file name.

avatar image By tanay ♦ 3.4k answered May 18, 2013 at 11:10 PM
more ▼
(comments are locked)
avatar image padma May 04, 2016 at 07:10 AM

Is this answer still Valid for Electric Flow 6.2? I have a similar need where I am looking for not displaying Log link for the steps in the email where there is no log. I tried to do like this. It works partially but shows logs for some steps even though shouldn't as log doesn't exist. So, I still see logs link for : 1. the steps calling sub procedure which ideally should show blank. 2. the steps that got cancelled due to previous errors. Which also should be ideally blank. var jobStepLogName = jobStep.logFileName == null ? "" : jobStep.logFileName.replace(/ /g, "+"); var jobStepLogLink = jobStep.logFileName == null ? "" :"https://xyz/commander/link/workspaceFile/jobSteps/" + jobStep.jobStepId + "?fileName=" + jobStepLogName;

10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question


Topics:

x999
x23
x23

asked: May 16, 2013 at 07:08 AM

Seen: 1757 times

Last Updated: May 04, 2016 at 07:10 AM

Related Questions