Variable description

1.Introduction

    There may be many variables in a model, but they may not be known when editing the model. The variable description function can solve this problem.

2.Method of creating variable description

2.1.Defined in MetaThing

     Variable description model is defined in MetaThing. When adding variable description model, you need to select MetaThing.

2.2.xworker.lang.VariableDesc

   VariableDesc objects are created after the variable description model is executed, and VariableDesc is used to describe variables.

2.3.Variable type

     When describing a variable, the type attribute specifies the type, and the assistance provided by different types may be different.

  • action
    A variable is an action.
     
  • actionContainer
    A variable is an ActionContainer。
     
  • object
    A variable is an object.
     
  • thing
    A variable ia a thing model. 

  2.4.Location and priority of variable description

     Variables can be defined on the descriptor or on the current model. If variables with the same name are redefined repeatedly, the priority of validity is the current model > parent model > descriptor and its inheritance > descriptor and its inheritance of parent model, etc.

3.Examples

3.1.Code Editor

     Variables can be assisted in the code editor.

3.2.Select variables in the property editor

     Variable selectors can be used in property editors.

    

Copyright ©  2007-2019 XWorker.org  版权所有  沪ICP备08000575号