Leave feedback
  • Question

    RuleService: Failed to acquire rule.

Enter a new topic
  • Thomas Fitting Thomas Fitting
    0 likes 2444 views

    Hi,

    I have an error from time to time with a storyteller/CC project.

    0803 130227 (0238) 1 RuleService: Failed to acquire rule.
    0803 130227 (0418) 1 Cannot execute script.

    ... and that's it. Also the verbose debug doesn't show more info.

    I think the error comes from an Storyteller process somewhere in the scripting.

    Does anyone else had this problem?

    Best
    Thomas

     

     

    Friday 03 August, 2012
  • Best Answer
    David Bares David Bares OpenText Employee Administrator StreamServe Employee
    2 likes

    It seems to me, that "Cannot execute script." is a message fired by StoryTeller, so it should not be Composition Center rule evaluation problem.

    Standard scripts are checked for syntax when StoryTeller process is loaded into server.

    In some cases though this is not the case. For example when you link to a fragment or story dynamically. In that case the script is compiled the first time it gets used. For loading the scripts dynamically StoryTeller uses same "RuleService" as Composition center uses for evaluating the business rules.

    By default you should not have problems, because you do your syntax checking in StoryTeller tool. But from my experience there is one exception: if the script uses local variables.
    That is ok in standard script, but fails the check when loading through RuleService. Something that should get fixed eventually.

    A workaround for that is to enclose the script into curly brackets.

    {
    num i, count=3;
    for(i=0;i<count;i++) $sum=num($sum)+i;
    }

    There may be other cases too that pass the syntax check in tool but fail in server. And if the script is loaded dynamically after server started some jobs, you will get this error.

    We may need something more concrete if we should goo deeper here. Like what did you have to do to fix the problem once you triggered it.

    Friday 03 August, 2012
  • Dave Lahn Dave Lahn OpenText Employee
    0 likes

    Hi Thomas,

    I'm guessing that one of the rules in your WebContent database is not synched properly. I've seen this happen before. I would recommend re-saving the rules in Composition Center associated with the document where you saw this error.

    Dave

    Friday 03 August, 2012
  • David Bares David Bares OpenText Employee Administrator StreamServe Employee
    2 likes

    It seems to me, that "Cannot execute script." is a message fired by StoryTeller, so it should not be Composition Center rule evaluation problem.

    Standard scripts are checked for syntax when StoryTeller process is loaded into server.

    In some cases though this is not the case. For example when you link to a fragment or story dynamically. In that case the script is compiled the first time it gets used. For loading the scripts dynamically StoryTeller uses same "RuleService" as Composition center uses for evaluating the business rules.

    By default you should not have problems, because you do your syntax checking in StoryTeller tool. But from my experience there is one exception: if the script uses local variables.
    That is ok in standard script, but fails the check when loading through RuleService. Something that should get fixed eventually.

    A workaround for that is to enclose the script into curly brackets.

    {
    num i, count=3;
    for(i=0;i<count;i++) $sum=num($sum)+i;
    }

    There may be other cases too that pass the syntax check in tool but fail in server. And if the script is loaded dynamically after server started some jobs, you will get this error.

    We may need something more concrete if we should goo deeper here. Like what did you have to do to fix the problem once you triggered it.

    Friday 03 August, 2012
  • Thomas Fitting Thomas Fitting
    0 likes

    Hi David,

    Thank you for this detailed insight to Storyteller. It seams to make sense to me:

    There is a storyteller document, that is included in annother storyteller process. Inside of this included document, some scripting is used to fill variables. Also local variables are used. I have attached the script that produces this error.

    The error does happen although, I have enclosed all of the sections of the script with curled brackets. I have attached the script, i think the error is produced in. There is also a Support Ticket for this.

    Best
    Thomas

    Monday 06 August, 2012

    Attached files

  • Thomas Fitting Thomas Fitting
    0 likes

    Now, I have enclosed the whole script with curled brackets and declared the variables on top of the script, but the result is the same.

    Monday 06 August, 2012
  • Thomas Fitting Thomas Fitting
    0 likes

    There were some more scripts that lead to errors this way. I have enclosed all of them with curled brackets, and it works now.

    Monday 06 August, 2012