I am trying to resume processing a topic at a particular point. My strategy is to have a predictable label on a rule in the topic and test to see if that rule exists, if it does then I want to do normal ^respond() processing starting at that point. My topic has keep and repeat in the topic specification. What I am seeing is that the ^respond(~topic.rulelabel) is always failing and I don’t know why.
The documentation for ^respond() states:
If a value designates a labelled or tagged rule (e.g., ~mytopic.mylabel or ~mytopic.1.0) then the system will skip over all rules until it reaches that rule, then begin linear scanning,
The documentation for ^available() state:
Sees if the named rule is available (1) or used up (0). If you supply the optional argument, the function will fail if the rule is not available.
When I run this code:
$$_goal = ^join(%topic . RESUME_GOAL)
^log(\n testing to see if $$_goal is available)
if( ^available($$_goal optionalfail)){
^nofail(TOPIC ^respond($$_goal))
}
which refers to this topic and rule
topic: ~jenkins-jobs-job-builds-getLatestBuild keep repeat (~jenkins_topics get latest last build )
u: TRY_MATCH ( build~n )
^addtopic(~)
$$_getLatestBuild_Active = true
u: END_NON_MATCH ($$_getLatestBuild_Active==null) ^fail(TOPIC)
u: RESUME_GOAL () # entry point for control script to retry running this goal
^log( \n RESUME_GOAL for ~)
I get this in my trace log.
testing to see if ~jenkins-jobs-job-builds-getlatestbuild.RESUME_GOAL is available
...NOPROBLEM ^log(\n testing to see if $$_goal is availabl) => ``
....If
....System call ^available(`~jenkins-jobs-job-builds-getlatestbuild.RESUME_GOAL`)
....NOPROBLEM ^available(~jenkins-jobs-job-builds-getlatestbuild.) => `1`
.... ^available PASS-if
...System call ^nofail(`TOPIC ^respond ( $$_goal )`)
....,.System call ^respond(`~jenkins-jobs-job-builds-getlatestbuild.RESUME_GOAL`)
....,...Respond trying ~jenkins-jobs-job-builds-getlatestbuild.RESUME_GOAL
....,.FAILRULE ^respond(~jenkins-jobs-job-builds-getlatestbuild.) => ``
...NOPROBLEM ^nofail(TOPIC ^respond ( $$_goal )) => ``
...End If