x
login Signup

Why would /myJob/procedureName return an absolute property path?

We have some code that looks like this, in essence:

$jobProj = $ec->getProperty('/myJob/projectName')->findvalue("//value");
$jobProc = $ec->getProperty('/myJob/procedureName')->findvalue("//value");
print "Saving '/projects[$jobProj]/procedures[$jobProc]/some_property' = '$val'\n";
$ec->setProperty("/projects[$jobProj]/procedures[$jobProc]/some_property", $val);

In almost all cases, this works as expected. For example:

Saving '/projects[proj - Traffic Processing System - Map Matcher]/procedures[Build]/some_property' = '8781'

Project was 'proj - Traffic Processing System - Map Matcher', procedure was 'Build', and everything is fine. But in ONE case so far, we see this:

Saving '/projects[sand - vcarnogu - Module C]/procedures[/projects/sand - vcarnogu - Module D/procedures/TRUNK CI]/some_property' = '2947'

Project was 'sand - vcarnogu - Module C', but the procedure came back as '/projects/sand - vcarnogu - Module D/procedures/TRUNK CI' instead of simply 'TRUNK CI'.

Why would that be, for only this one procedure?

avatar image By dougshea 37 asked Mar 13, 2013 at 12:43 PM
more ▼
(comments are locked)
10|750 characters needed characters left

2 answers: sort voted first

Workflows are the cause. In this case, there is a workflow in Module C that has a state that has an action that is a procedure in Module D. The resulting job shows itself as having a Project of Module C, but the Procedure shows both a Project and a Procedure name, which is why the API returns a full path.

avatar image By dougshea 37 answered Mar 13, 2013 at 12:56 PM
more ▼
(comments are locked)
10|750 characters needed characters left

Could it be the case when the procedure is in a different project?

avatar image By lrochette 5.9k answered Mar 13, 2013 at 12:48 PM
more ▼
(comments are locked)
avatar image dougshea Mar 13, 2013 at 12:50 PM

But the Job itself is only created from one procedure in one project, isn't it? Shouldn't /myJob/projectName and /myJob/procedureName give the procedure that launched the job and the project that procedure is in?

avatar image dougshea Mar 13, 2013 at 12:56 PM

Of course, it's never that simple. Workflows are the cause.

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.