Skip to main content

STORED - Workflow Service

[attribute := ] expression : STORED( storedname [, FEW ][, FORMAT( [SELECT(valuestring)] [FIELDWIDTH(widthvalue)][,FIELDHEIGHT(heightvalue)][,SEQUENCE(sequencevalue)][,NOINPUT)][,PASSWORD)]] ) ;

attributeOptional. The name of the Attribute.
expressionThe definition of the attribute.
storednameA string constant containing the name of the stored attribute result.
FEWOptional. When the expression is a dataset or recordset, FEW specifies that the dataset is stored completely within the workunit. If not specified, then the dataset is stored as a THOR file and the workunit contains only the name of the file. The FEW option is required when using STORED in a SOAP-enabled MACRO and the expected input is a dataset (such as tns:xmlDataset).
FORMATOptional. FORMAT specifies options for formatting the field on a Web form in WsECL.
SELECTOptional. SELECT specifies a droplist input control on a Web form in WsECL.
valuestringAn string containing the possible values for the droplist. An asterisk (*) denotes the default value. A expression in the form of 'apple=1' within the string allows text to display and a different value to be stored. In that example, apple would display but a value of 1 is stored if the user selects apple.
FIELDWIDTHOptional. FIELDWIDTH specifies the width of the input box on a Web form in WsECL.
widthvalueAn integer expression defining the width (number of characters) of the input box
FIELDHEIGHTOptional. FIELDHEIGHT specifies the height of the input box on a Web form in WsECL.
heightvalueAn integer expression defining the height (number of rows) of the input box
SEQUENCEOptional. SEQUENCE specifies field ordering on a Web form in WsECL.
sequencevalueAn integer expression defining the sequential location of the input box. These can be sparse values (e.g., 100, 200, 300) to allow insertion of new inputs in the future.
NOINPUTOptional. If NOINPUT is specified, the field is not displayed on the Web form in WsECL.
PASSWORDOptional. If PASSWORD is specified, a password entry box is used on the Web form in WsECL and the field's supplied value is not displayed while entering it. The value is also hidden when viewing stored values in the workunit through EclWatch or from the command line when extracting the WU XML.

The STORED service stores the result of the expression with the work unit that uses the attribute so that it remains available for use throughout the work unit. If the attribute name is omitted, then the stored value can only be accessed afterwards from outside of the ECL execution. If an attribute name is provided then the value of that attribute will be pulled from storage, if it has not yet been set it will be computed, stored and then used from storage. This service implicitly causes the attribute to be evaluated at a global scope instead of the enclosing scope.

STORED creates a storage space in the workunit where the interface can place the values to pass to a published query. See Working with Roxie in the Programmer's Guide.

Example:

  COUNT(person) : STORED('myname');
     // Name in work unit is myname,
     // stored value accessible only outside ECL
  fred := COUNT(person) : STORED('fred');
     // Name in work unit is fred
  fred := COUNT(person) : STORED('mindy');
     // Name in work unit is mindy

//FORMAT options for WsECL form
  
  Password :='' := STORED('Password',FORMAT(SEQUENCE(1),PASSWORD));
                                      //password entry box on form
  Field1 := 1 : STORED('Field1',FORMAT(SEQUENCE(10)));
  Field2 := 2 : STORED('Field2',FORMAT(SEQUENCE(20)));
  AddThem := TRUE :STORED ('AddThem',FORMAT(SEQUENCE(15))); 
                                      // places field in between Field1 and Field2
  HiddenValue := 12 :STORED ('HiddenValue',FORMAT(NOINPUT)); // not on form
  TextField1 :='Fill in description' :Stored('Description',
                                      FORMAT(FIELDWIDTH(25),FIELDHEIGHT(2),
                                      SEQUENCE(5))); 
                                       //Creates 25 char wide, 2 row high input box

//SELECT options

  UNSIGNED8 u8 := 0   : STORED('u8', FORMAT(fieldwidth(8), 
                                     SEQUENCE(18), 
                                     SELECT('one=1,two=2,three=3,*four=4')));
  STRING ch1 := 'ban' : STORED('ch1', FORMAT(SELECT('apple=app,pear,*banana=ban'))); 
                                                   //banana is default
  STRING ch2 := ''    : STORED('ch2', FORMAT(SELECT(',apple=app,pear,banana=ban'))); 
                                                   //starts empty, no specified default
  STRING ch3 := ''    : STORED('ch3', FORMAT(SELECT('apple=app,pear,*,banana=ban')));
                                                   //empty in middle, empty is default

See Also: STORED function, #WEBSERVICE