Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

AyMINE

Related links


FI - Finance Management

Commands script.<command>

Commands for orchestration command processing

Script commands are used in the orchestration string to manage the script flow. AyMINE Application evaluates them internally.

Not found what you are looking for? Check the run… commands because it could be there

Command script.stop(status=,message=)

Command stops further script processing. If it has defined attributes, it returns defined return message.

   "= attr.selectNothing ? 'list.stop' : false "

Command stops the script processing if attribute selectNothing is defined. However, it is much better to show some message about the stop:

   "= attr.selectNothing ? 'list.stop(status=Cancel,message=mStopReason)' : false "

The constant mStopReason should have translation in the translations for object that called the operation.

Let's note that selectNothing is true when select list allows close without selection. If that is no allowed and user close the window, script processing is closed immediately.

Command script.skip(step=)

Command skips next commands. If value step is not defined next single step is skipped

Example

   "= attr.selectNothing ? 'foo' : 'script.skip'",
   "script.stop",
   "baa"

Example is the simplest possible construct if else:

  • if attr.selectNothing is defined start operation foo and stop the execution (defined in the second line)
  • else skips the next line and continue to the baa command

Usage

Definitely as mentioned in the example – command simplifies decisions in the script

Notes

  • script.skip(step=) make effectively nothing and the processing continues to the next script line. Using simply false makes more sense – it would be faster and readable.
  • step < 0 is not allowed and fails with error. Script cycling is not supported. (If somebody comes with some usable reason for cycles, it could be changed.)

Command list.clearStack

Command deletes all attributes that are passed in the script execution from command to command. Next command is processed without any attributes. Object is not cleared so that obj... fields are still available.

Command list.copyAttr(group=)

Command copy group of attributes from the previous command processing to the next one.

By default new commands in the script do not add new attributes to the processing list but this operation can change it and allows its usage for next command processing.

Usage

Usable only in case that command calls module-specific method in the linked module that returns attributes. This method allows their further usage, e.g. send to the server in the command

Assign attribute script.set(name=,value=,group=)

Script might need to set value to the attributes.

   "script.set(name=linkedObjects,value=attr.selectedObjName)"

Script set value to the script attribute.

Script is equal with the command:

   "={attr._a.addVal('linkedObjects', attr.selectedObjName)}"

Method attributes

  • name name of the new attribute to set; required
  • value value to set; required
  • group group of the new attribute; optional, when no defined fceParam is the default used value

Usage

Ordinary situation occurs, when there are more selections during the script execution (including selection before the script starts) and script should send to the server information about all selections. Since the select list setup always the same attribute selectedObjName script should store its value to some other attribute before it is rewritten by the next selection.

   1: "script.set(name='objID',value='obj.objID',group='linkID')",
   2: "script.set(name=forObjID,value=obj.next_object_ID)",
   3: "server.obj.checkFoo",
   4: "=attr.checkFoo ? 'script.skip' : 'window.confirm(question=make_function)' ",  
   5: "select.object2.list(purpose=selectOne,location=modal,selectNothing=nothingButton)",

In the example:

  1. Line creates attribute objID that is passed to the all called functions. (Server function at the line 3 as well as other method called by the script can use it.
  2. Line saves important values necessary for further processing
  3. Line calls server function to get information used in the next line; server function returns attribute checkFoo (it is not visible in the script, author should know what the server function does)
  4. Line makes decision according to the information from server. When server return true / 1, the 5th line is overskipped (script.skip) and when it is true, user is requested to confirm operation. If user do not confirm, script is canceled
  5. Line User is requested to select single value (selectNothing=nothingButton) says that he can also complete without selection