Bug 4672 - SPEC: How to identify the first job element.
SPEC: How to identify the first job element.
Status: RESOLVED FIXED
Product: jbatch
Classification: Unclassified
Component: source
1
All All
: P5 normal
: ---
Assigned To: cvignola
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-12 22:16 UTC by cvignola
Modified: 2013-02-28 22:47 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cvignola 2013-02-12 22:16:40 UTC
The first job element can be a step, flow, split, or a decision. I'm 
wondering how an implementation determines which element should be the 
first to run inside a job.

Or is there a requirement that applications have to order them in a 
particular way? for example, the first non-abstract element under <job> 
is the first to run.

I didn't find such language in the current spec draft.  So looks like 
this is left to implementations.  I think this is an area that can 
benefit from more detailed spec coverage, at least provide some 
guidelines, usage tips, etc.

I guess one way is to traverse all next attr/element values, and if the 
id of any non-abstract step/decision/flow/split is not referenced as 
next by others, then it can be the head.   Steps, split, flows and 
decisions can be nested in multiple levels.

Some steps are not used as next, but exist as the parent of others:

<job>
<step id="parent">
   ...
</step>

<step id="child" parent="parent">
...
</step>
</job>

In the above example, I find both steps can be the head.  So in order to 
identify "child" is the element to run, we will also need to exclude 
those that are parent of other elements.

Just wanted to share my questions and thoughts, and would like to hear 
your insights and comments.

Cheng
Comment 1 ScottKurz 2013-02-23 16:00:12 UTC
The spec does say:

"The first step, flow, or split defines the first step (flow or split) to execute for a given Job XML."

In the case of inheritance, would this be the first in the parent or child ?
Comment 2 cvignola 2013-02-28 22:47:13 UTC
The spec says this: 

"5.2.5	Step Sequence 

The first step, flow, or split defines the first step (flow or split) to execute for a given Job XML.  The 'next' attribute on the step, flow, or split defines what executes next."


I will clarify the paragraph to make it clear that "first" means in order of occurrence parsing from beginning to end of the xml document. In the case of a step, the "first" step must be abstract=true.


This update will go into PFD v1.5.


Concerning inheritance,  this matter of "first" could apply only to job inheritance and job inheritance explicitly excludes inheritance of steps, flows, splits, and decisions, as per section 5.8 Job XML Inheritance.