Mass enabling edicts stemming from a (changed) prototype?

Hi,

I am using Tinderbox to do the marking of term papers. And I have a problem for which any help is greatly appreciated:
The prototype for a students term paper in my TBX file is a container which includes six criteria (which have their own prototype). The latter prototype has an edict, and for some reason I did not set that to “Enabled” in the prototype. As a consequence, all the students’ term paper entries in my TBX file which I created now have a disabled edict and thus do not run.
At 6 criteria notes per term paper note and some 40 or so term papers I am desperately looking for a way to not do that manually :grimacing:
I did correct the prototype, but due to inheritance this has no influence on the already created term paper notes and their content.
If there is a way to mass enable these edicts, I would be very grateful for a precise description on how to implement it - I would hate to mess things up…
Many thanks in advance,

Andreas

$Edict Disabled (and $RuleDisabled) are intrinsic. Toggling this in a prototype has no effect on notes using that prototype as intrinsic attributes are thus heir values is never inherited.

By (doc-level) default, the $EdictDisabled and $RuleDisabled are both set to false, i.e. the actions is enabled. In the Action Inspectors the labelling is reversed, an $EdictDisabled of false is shown as ‘Enabled’ with the control ticked. Un-ticking the box sets $EdictDisabled to true. Confusing at first encounter but it makes for a more intuitive presentation in the Inspector!

So, given the above, I doubt the cause is as you imagine. Given that $EdictDefault has a doc-level default false setting and settings are not (prototype) inherited, for a note to have its Edict disabled, one of two things must have happened:

  • $EdictDisabled was altered by action code (OnAdd, agent action, etc.).
  • $EdictDisabled was manually altered in the Action/Edict Inspector.

So, you have notes using one of 6 different prototypes where all/some of them have $EdictDisabled set to true. Instead, you wish all of them to have $EdictDisabled set to false.

OK, lets assume the per-criteria prototypes are called ‘pCriterionA’, ‘pCriterionB’, ‘pCriterionC’, ‘pCriterionD’, ‘pCriterionE’, ‘pCriterionF’ and the these are used in notes where their parent uses prototype ‘pTermPaper’.

Now make an agent with the query:

$Prototype(parent(original))=="pTermPaper" & $Prototype.beginsWith("pCriterion")

This will first find any notes.containers where the parent container uses the prototype ‘pTermPaper’ prototype and where the children use with a prototype whose name starts with ‘pCriterion’, i.e. all 6 prototype types. IOW, the note you need to update.

Now the agent action:

$EdictDisabled(original) = false;

We set the ‘original’ as the attribute is intrinsic and we are acting on a alias.

All your edicts should now be enabled

1 Like

The problem as I understand it:

  1. Each instance of a Term Paper inherits six instances of A Criterion.
  2. Those inherited instances have $EditDisabled set to true — perhaps because they were cloned from the children of a Term Paper and those children have disabled their edicts,

To use an agent to fix this:

  1. Set the Query to find instances of a Term Paper: $Prototype=="a Term Paper
  2. For each child, enable the edict: $Path(children).each(x){$EdictDisabled(x)=false;

Many thanks to both @mwra and @eastgate for your detailed answers to my problem! However, I had to solve the problem manually nevertheless (see below) because I had overlooked a problem that I did not include in my initial description:

My term paper prototype (“Prüfungsleistung” in German) is a container (as described) that includes six criteria of prototype “pPrüfungskriterium”. However, as I noticed, these were not the same as the separately existing prototype “pPrüfungskriterium”, because each of these contained detailed (and specific) edicts that would (upon setting a value in one displayed attribute) give a numeric mark and put (dependent on the value) some textual description into the $Text of that note.

Hence I faced the choice of either creating a specific prototype for each criterion (as Mark A. assumed was the case) which would have been a lot of work, or of doing it manually nevertheless.

Fortunately I found a third way which consisted of copying the criterion notes afresh and replacing the six existing (and disabled) notes in each term paper container with new ones. That was one brief operation for each term paper - and much less time consuming than opening each criterion note and manually setting the Edict to “enabled”. So that is what I did at the end of my work day when my concentration dropped for marking but was still sufficient for manual tasks :wink:

Now things are working - many thanks again for your help! I will certainly not make that mistake again.

1 Like