Sure, it works...
verifican = 0
For registros_selected = 0 to Count()-1
MoveTo(registros_selected)
If IS_SELECTED = "1" Or IS_SELECTED = 1 Then verifican = verifican + 1
Next
NUM_REG_SELECTED = Mid(verifican,0,StrIn(verifican,"."))
or
NUM_REG_SELECTED = ToString(IS_SELECTED..SysTotalItems(M4_TOTAL_SUM), 0)
Tuesday, 4 November 2008
Tuesday, 7 October 2008
Combo-Box With Fixed Values
The data of a combo box can either be populated directly (from OBL) or dynamically using a list group. In this case, the values are populated directly. The visible entries of the combo box are defined in Listitems (multiple language supported) and the associated values are defined in Values; the entries are separated by comma ','.
BEGIN Combobox Combobox
Iditem = "MyItem"
Left = 174
Top = 4
Width = 300
Height = 20
Listitems = "One,Two,Other"
Values = "1,2,"
END
Results in a combobox with tree entries:
- One (1)
- Two (2)
- Other (null)
BEGIN Combobox Combobox
Iditem = "MyItem"
Left = 174
Top = 4
Width = 300
Height = 20
Listitems = "One,Two,Other"
Values = "1,2,"
END
Results in a combobox with tree entries:
- One (1)
- Two (2)
- Other (null)
Wednesday, 24 September 2008
Run New Presentation Based on Existing Instance
When you plan to implement e.g. a wizard, it might come in handy to run several presentations based on the same instance of a Meta4Object.
To open a new presentation use the element "Extends"; the Idinstance indicates the presentation to open. If the property Inheritdata is set to 1, the presentation uses the current instance of the Meta4Object.
The following code could represent the event click of the button "Next".
BEGIN Evclick evclickNext
BEGIN Extends extNextStep
Idchannel = "CRCO_PA_MT_WIZARD"
Idnode = "CRCO_PA_MT_WIZARD"
Iditem = "SRCO_LB_CANCEL"
Idinstance = "CRCO_PA_MT_WIZARD_S2"
Inheritdata = 1
END
BEGIN Action_call acUnloadForm
Sentence = "*O*../../../../Form.Unload(END_OK)"
END
END
Note: The Idchannel (Meta4Object) of the current and the new presentation should be the same.
To open a new presentation use the element "Extends"; the Idinstance indicates the presentation to open. If the property Inheritdata is set to 1, the presentation uses the current instance of the Meta4Object.
The following code could represent the event click of the button "Next".
BEGIN Evclick evclickNext
BEGIN Extends extNextStep
Idchannel = "CRCO_PA_MT_WIZARD"
Idnode = "CRCO_PA_MT_WIZARD"
Iditem = "SRCO_LB_CANCEL"
Idinstance = "CRCO_PA_MT_WIZARD_S2"
Inheritdata = 1
END
BEGIN Action_call acUnloadForm
Sentence = "*O*../../../../Form.Unload(END_OK)"
END
END
Note: The Idchannel (Meta4Object) of the current and the new presentation should be the same.
Tuesday, 19 August 2008
Use of Function: DialogBox
The function DialogBox displays a message, the buttons included in the dialog are controlled by an argument.


Syntax: DialogBox(Style, Title, Body[, Body])
Style (determines the buttons displayed; one of the following macros):
- M4_BTN_OK
- M4_BTN_OK_CANCEL
- M4_BTN_ABORT_RETRY_IGNORE
- M4_BTN_YES_NO_CANCEL
- M4_BTN_YES_NO
- M4_BTN_RETRY_CANCEL
Return value (one of the following macros):
- M4_OK
- M4_CANCEL
- M4_ABORT
- M4_RETRY
- M4_IGNORE
- M4_YES
- M4_NO
Note: For multiple language support use the function GetErrorString to identify the title and body.
Note: For execution in server, the function assumes the result M4_OK. However, make sure you use the function only in client.
Monday, 18 August 2008
[Workflow] With Deadline
A deadline is the date (with timestamp) by which the task must be completed. If the deadline is reached, the instance of the workflow expires.
A deadline can be defined at level of the workflow or at level of a status. The deadline can be defined either as an absolute date or relative to the instantiation of the workflow, the instantiation of the status or a variable.

If the deadline is reached, the instance of the workflow is cancelled automatically; the task(s) disappear form the active to-do list and the instance is shown in the workflow manager as finished (if positioning on the instance, the last active status is highlighted).
In case of a deadline defined at workflow level, an alternative workflow can be indicated that is instantiated when the deadline is reached (the current instance is cancelled and a new instance of the alternative workflow is instantiated).
In case of a deadline defined at status level (see image), an alternative transition can be indicated that is "fired" when the deadline is reached (the current status is cancelled and the status linked to by the alternative transition becomes active).
Note: If the state has a deadline associated, the number of days for the task to become critical can be defined.
Note: The concept of Workflow/Transition Associated to Cancellation is new in version 7.1 SP002 (of technology).
A deadline can be defined at level of the workflow or at level of a status. The deadline can be defined either as an absolute date or relative to the instantiation of the workflow, the instantiation of the status or a variable.

If the deadline is reached, the instance of the workflow is cancelled automatically; the task(s) disappear form the active to-do list and the instance is shown in the workflow manager as finished (if positioning on the instance, the last active status is highlighted).
In case of a deadline defined at workflow level, an alternative workflow can be indicated that is instantiated when the deadline is reached (the current instance is cancelled and a new instance of the alternative workflow is instantiated).
In case of a deadline defined at status level (see image), an alternative transition can be indicated that is "fired" when the deadline is reached (the current status is cancelled and the status linked to by the alternative transition becomes active).
Note: If the state has a deadline associated, the number of days for the task to become critical can be defined.
Note: The concept of Workflow/Transition Associated to Cancellation is new in version 7.1 SP002 (of technology).
Tuesday, 22 July 2008
List of LN4 Macros
LN4 macros are a series of constants that can be used in LN4 code.
Basic Macros
Basic Macros
- M4_TRUE
- M4_FALSE
- M4_SHORT_DATE_FORMAT
- M4_LONG_DATE_FORMAT
- M4_SUCCESS
- M4_ERROR
- M4_ZERO
- M4_POSITIVE
- M4_NEGATIVE
- M4_EQUAL
- M4_DISTINCT
- M4_GREATER
- M4_SMALLER
- M4_GREATER_OR_EQUAL
- M4_SMALLER_OR_EQUAL
- M4_EQUAL_OR_NULL
- M4_DISTINCT_OR_NULL
- M4_GREATER_OR_NULL
- M4_SMALLER_OR_NULL
- M4_GREATER_OR_EQUAL_OR_NULL
- M4_SMALLER_OR_EQUAL_OR_NULL
- M4_CASE_EQUAL
- M4_CASE_DISTINCT
- M4_CASE_GREATER
- M4_CASE_SMALLER
- M4_CASE_GREATER_OR_EQUAL
- M4_CASE_SMALLER_OR_EQUAL
- M4_CASE_EQUAL_OR_NULL
- M4_CASE_DISTINCT_OR_NULL
- M4_CASE_GREATER_OR_NULL
- M4_CASE_SMALLER_OR_NULL
- M4_CASE_GREATER_OR_EQUAL_OR_NULL
- M4_CASE_SMALLER_OR_EQUAL_OR_NULL
- M4_REGULAR_EXPRESSION
- M4_REGULAR_EXPRESSION_OR_NULL
- M4_CASE_REGULAR_EXPRESSION
- M4_CASE_REGULAR_EXPRESSION_OR_NULL
- M4_BTN_OK
- M4_BTN _OK_CANCEL
- M4_BTN _ABORT_RETRY_IGNORE
- M4_BTN _YES_NO_CANCEL
- M4_BTN _YES_NO
- M4_BTN _RETRY_CANCEL
- M4_OK
- M4_CANCEL
- M4_ABORT
- M4_RETRY
- M4_IGNORE
- M4_YES
- M4_NO
- M4_TOTAL_COUNT
- M4_TOTAL_SUM
- M4_TOTAL_AVG
- M4_TOTAL_MAX
- M4_TOTAL_MIN
- M4_TOTAL_FIRST
- M4_TOTAL_LAST
- M4_COMMIT
- M4_ROLLBACK
- M4_ROLLBACK_RESUME (not for EndDBTransaction)
- M4_EXECUTE_POSTVALIDATION
- M4_TRIM_LEFT
- M4_TRIM_ALL
- M4_TRIM_RIGHT
- M4_LOWERCASE
- M4_UNCHANGED
- M4_UPPERCASE
- M4_SCOPE_ALL
- M4_SCOPE_REGISTER
- M4_SCOPE_BLOCK
- M4_SCOPE_NODE
- M4_TYPE_ALL
- M4_TYPE_METHOD
- M4_TYPE_PROPERTY
- M4_TYPE_FIELD
- M4_TYPE_CONCEPT
- M4_NEW_LINE
- M4_TAB
- M4_DOUBLE_QUOTE
- M4_CR
- M4_ATT_SYS_SLICE_NUMBER
- M4_ATT_SYS_START_DATE
- M4_ATT_SYS_END_DATE
- M4_ATT_SYS_FIRST_SLICE
- M4_ATT_SYS_LAST_SLICE
- M4_ATT_SYS_OLD_VALUE
- M4_ATT_SYS_BLOB_DESCRIPTION
- M4_ATT_SYS_BLOB_MASK
- M4_ATT_SYS_AUX_ITEM_ID
- M4_ATT_SYS_ADD_NEW_SLICE
- M4_ATT_SYS_CREATE_SLICE
- M4_ATT_SYS_SPLIT_SLICE
- M4_ATT_SYS_TOTALIZE_ITEMS
- M4_ATT_SYS_TOTALIZE_SLICES
- M4_ATT_SYS_CREATE_BLOB_FILE
- M4_ATT_SYS_SET_BLOB_DESCRIPTION
- M4_AUTOLOAD_OFF
- M4_AUTOLOAD_BLOCK
- M4_AUTOLOAD_PRG
- M4_AUTOLOAD_NODESAYS
- M4_ERRORLOG
- M4_WARNINGLOG
- M4_DEBUGINFOLOG
- M4_ASCENDING
- M4_DESCENDING
- M4_SEND_NO_BRANCH
- M4_SEND_BRANCH
- M4_SEND_RESET
- M4_MINUS_INF
- M4_PLUS_INF
- M4_VARIANT_TYPE_NULL
- M4_VARIANT_TYPE_NUMBER
- M4_VARIANT_TYPE_STRING
- M4_VARIANT_TYPE_DATE
- M4_INSTANCE_NOT_SHARED
- M4_INSTANCE_LOCAL_SHARED
- M4_INSTANCE_GLOBAL_SHARED
- M4_YEAR
- M4_MONTH
- M4_DAY
- M4_WEEK
- M4_COMPLETE_WEEK
- M4_HOUR
- M4_MINUTE
- M4_SECOND
- M4_OPEN_MODE_NO_LOAD
- M4_OPEN_MODE_LOAD
- M4_OPEN_MODE_AUTOLOAD_BLOCK
- M4_OPEN_MODE_AUTOLOAD_PRG
- M4_OPEN_MODE_AUTOLOAD_NODESAYS
- M4_ORGANIZATION_L2_TYPE_NONE
- M4_ORGANIZATION_L2_TYPE_MONO
- M4_ORGANIZATION_L2_TYPE_MULTI
- M4_ORGANIZATION_L2_TYPE_FATHER
- M4_ORGANIZATION_L2_TYPE_ANY
- M4_CSTYPE_FRONT
- M4_CSTYPE_BACK
- M4_CSTYPE_BOTH
- M4_CSTYPE_DEBUG
- M4_CSTYPE_MAPPED
- M4_KEEP_SLICES
- M4_KEEP_RECORDS
- M4_KEEP_ONE_RECORD
- M4_DEFAULT_CS_TIMEOUT
- M4_NEXT_CS_TIMEOUT
- M4_GENERIC_CS_TIMEOUT
- M4_RESET_NEXT_TIMEOUT
- M4_ENABLE_TIMEOUT_WINDOW
- M4_MATH_PI
- M4_MATH_E
- M4_LANG_LOGON
- M4_LANG_DEVELOPMENT
Default List With Icon
There is a very easy way to include an icon in an automatically generated list.
The only thing to do is to add an item (property or concept) to the node structure that contains the data of the list (mostly …TR…) and assign the name of the icon to it.
This property should be of type string, exist in client and be visible and MUST have the Internal Type 84 (List Icon). The icon can be either an icon provided by Meta4, e.g. “PERSON” (as in the screen shot) or an image located in the Images folder.
Note: Images folder defined in: HKEY_LOCAL_MACHINE\SOFTWARE\Meta4\Mind\_3.X\Build\YourBuild\CLIENT\CLIENT\Presentation_Runtime_Vars\ImagesFolder; this key contains the path within double quotes (e.g. “C:\Meta4\Images\”).

This property should be of type string, exist in client and be visible and MUST have the Internal Type 84 (List Icon). The icon can be either an icon provided by Meta4, e.g. “PERSON” (as in the screen shot) or an image located in the Images folder.
Note: Images folder defined in: HKEY_LOCAL_MACHINE\SOFTWARE\Meta4\Mind\_3.X\Build\YourBuild\CLIENT\CLIENT\Presentation_Runtime_Vars\ImagesFolder; this key contains the path within double quotes (e.g. “C:\Meta4\Images\”).
Friday, 18 July 2008
Combo-Box With Data From List-Group
The data of a combo box can either be populated directly (from OBL) or dynamically using a list group. The list group must return the id and associated name; the id will not be visible but be passed to the item linked to the combo box (in the following example SRCO_ID_PM_TYPE), the name will be shown in the combo box.
BEGIN Combobox cboSRCO_ID_PM_TYPE
Iditem = "SRCO_ID_PM_TYPE"
Left = 174
Top = 4
Width = 300
Height = 20
Listgroup = "../lstgrpSRCO_ID_PM_TYPE"
Collabel = "##TM[SRCO_ID_PM_TYPE]"
END
BEGIN Listgroup lstgrpSRCO_ID_PM_TYPE
Iditem = "SRCO_ID_PM_TYPE"
Watchobject = "*O*../cboSRCO_ID_PM_TYPE.Visible"
BEGIN Function List
Idfuncchannel = "SRCO_PA_MT_PM_TYPE"
Idfuncnode = "SRCO_PA_MT_PM_TYPE"
Idfuncmethod = "LIST"
Mainargs = "ARG_SCO_ID_PM_TYPE"
Mainobjs = "SRCO_ID_PM_TYPE"
Targetitems = "SCO_ID_PM_TYPE,SCO_N_PM_TYPE"
Targetobjs = "SRCO_ID_PM_TYPE,SRCO_N_PM_TYPE"
END
END
BEGIN Combobox cboSRCO_ID_PM_TYPE
Iditem = "SRCO_ID_PM_TYPE"
Left = 174
Top = 4
Width = 300
Height = 20
Listgroup = "../lstgrpSRCO_ID_PM_TYPE"
Collabel = "##TM[SRCO_ID_PM_TYPE]"
END
BEGIN Listgroup lstgrpSRCO_ID_PM_TYPE
Iditem = "SRCO_ID_PM_TYPE"
Watchobject = "*O*../cboSRCO_ID_PM_TYPE.Visible"
BEGIN Function List
Idfuncchannel = "SRCO_PA_MT_PM_TYPE"
Idfuncnode = "SRCO_PA_MT_PM_TYPE"
Idfuncmethod = "LIST"
Mainargs = "ARG_SCO_ID_PM_TYPE"
Mainobjs = "SRCO_ID_PM_TYPE"
Targetitems = "SCO_ID_PM_TYPE,SCO_N_PM_TYPE"
Targetobjs = "SRCO_ID_PM_TYPE,SRCO_N_PM_TYPE"
END
END
Access Value of Slice by Index or Date
To read or write the value of an item with slices, you can either specify the slice directly (item[slice]; the first slice has index 0, and so on) or indicate the date as at which you want to read/write the value.
Syntax:
ItemId[slice] or
ItemId[{date}]
Example:
MY_ITEM with the following three slices
01.07.2008 to 15.07.2008: 20
16.07.2008 to 31.07.2008: 28
To identify the value of the item of the second slice use either:
NodeStructureID[Index].ItemId[{date}]
Syntax:
ItemId[slice] or
ItemId[{date}]
Example:
MY_ITEM with the following three slices
01.07.2008 to 15.07.2008: 20
16.07.2008 to 31.07.2008: 28
To identify the value of the item of the second slice use either:
- index (starting with 0)
x = MY_ITEM[1] - date (any date that falls within the period of the slice)
x = MY_ITEM[{2008-07-16}]
x = MY_ITEM[{2008-07-18}]
x = MY_ITEM[{2008-07-31}]
To modify the value of the second slice use either:
- index (starting with 0)
MY_ITEM[1] = 29 - date (any date that falls within the period of the slice)
MY_ITEM[{2008-07-16}] = 29
MY_ITEM[{2008-07-18}] = 29
MY_ITEM[{2008-07-31}] = 29
Note: It is also possible to combine this type of access with the access by node structure index:
NodeStructureID[Index].ItemId[{date}]
Access Values of Node Structure by Index
To identify the value of an item of a node structure, you can either position on the correct register (e.g. Begin, MoveTo, End) or use an index.
Syntax: NodeStructureID[Index].ItemId
Example: x = MY_NODE_STRUCTURE[1].MY_ITEM
Note: The advantage of using the index is that the current position of the node structure is not modified. That means you do not need to recover the position after moving (if relevant) and the system does not need to update the position pointers (specially if the node structure you access has more nodes beneath it).
Syntax: NodeStructureID[Index].ItemId
Example: x = MY_NODE_STRUCTURE[1].MY_ITEM
Note: The advantage of using the index is that the current position of the node structure is not modified. That means you do not need to recover the position after moving (if relevant) and the system does not need to update the position pointers (specially if the node structure you access has more nodes beneath it).
Thursday, 17 July 2008
[Workflow] Notification via Email
The user can be informed via email that a task has been assigned to him. The subject of the email contains the BPC description. The file .m4, which can be used to run the task directly in windows/rich client, is attached. The body of the email contains the state description and, if available, a URL to run the task in light client.
Note: The only dynamic parameter passed to the page is the work-item id (ID_WORKITEM) that is added automatically.
Example URL:
http://server.meta4.com:8100/sse_generico/english/generico_login.jsp?_A=/servlet/CheckSecurity/JSP&znivel=1&_B=/sse_generico/generico_invisible.jsp&_C=/mss_g1/mss_g1_p1_val.jsp?estado=11&ID_WORKITEM="work-item"
New in version 7.1 SP002 (of technology)
By default, the subject and the text of the email are retrieved from the description of the workflow and the description of the state; now exists the possibility to define an alternative subject/text for the email.
To enable the URL in the email, the two following conditions have to be met:
- The application parameter WORKFLOWRT / THINCLIENT / SERVER_URL should have a valid value, e.g. http://server.meta4.com:8100/.
- The task associated to the state should have code of type Thin Client Code assigned that contains two variables that ends with:
"_PREINITTASKPAGE" that is generic, e.g. "_PREINITTASKPAGE=/sse_generico/##LANG##/generico_login.jsp?_A=/servlet/CheckSecurity/JSP&znivel=1&_B=/sse_generico/generico_invisible.jsp&_C="
"_INITTASKPAGE" that indicates the page to be called, e.g. "_INITTASKPAGE=/mss_g1/mss_g1_p1_val.jsp?estado=11".
Note: The only dynamic parameter passed to the page is the work-item id (ID_WORKITEM) that is added automatically.
Example URL:
http://server.meta4.com:8100/sse_generico/english/generico_login.jsp?_A=/servlet/CheckSecurity/JSP&znivel=1&_B=/sse_generico/generico_invisible.jsp&_C=/mss_g1/mss_g1_p1_val.jsp?estado=11&ID_WORKITEM="work-item"
New in version 7.1 SP002 (of technology)
By default, the subject and the text of the email are retrieved from the description of the workflow and the description of the state; now exists the possibility to define an alternative subject/text for the email.
[Workflow] Identify Siblings of Workitem
This API returns the number of siblings of the given workitem that are in the same state, active and belong to the current user.
The details related to each workitem are provided in the main node of the Meta4Object (one record per work-item). The method Get Value can be used to identify the value of the BPC variables.
It can be used to identify, e.g. all employees with vacations pending approval. The user has a task assign to approve the vacations of a specific employee. To avoid that the user has to enter the presentation for each request individually, all pending requests can be identified and worked off at the same time.
Technical details
The details related to each workitem are provided in the main node of the Meta4Object (one record per work-item). The method Get Value can be used to identify the value of the BPC variables.
It can be used to identify, e.g. all employees with vacations pending approval. The user has a task assign to approve the vacations of a specific employee. To avoid that the user has to enter the presentation for each request individually, all pending requests can be identified and worked off at the same time.
Technical details
- Meta4Object: SWF_INSTANCE
- Node Structure: SWF_INSTANCE
- Method: GET_WORKITEM_SIBLINGS (ARG_ID_WORKITEM)
Returns number of siblings of the given workitem.The work-items can be retrieved from the property ID_WORKITEM. - Method: GET_VALUE (ARG_ID_VARIABLE)
Returns the value of the given variable for the currently positioned record.
[Workflow] Accept Code of Transition
The Accept Code of a transition is executed as a just-in-time call in the environment of the workflow engine when the transition is followed. It should return M4_SUCCESS; if it returns M4_ERROR, the workflow engine stops with an error.
It can be used to e.g. assign a value to a BPC variable, issue a message or cancel a transition.
Example: Issue warning message that includes the Person ID.
//Workflow for 0%:s instantiated
SetLog(M4_WARNINGLOG, 18, xx, yy, SWF_INST_DATA.Get(“ID_PERSON”))
Return(M4_SUCCESS)
Where xx and yy indicate the sub-module and number of the message to be issued.
It can be used to e.g. assign a value to a BPC variable, issue a message or cancel a transition.
Example: Issue warning message that includes the Person ID.
//Workflow for 0%:s instantiated
SetLog(M4_WARNINGLOG, 18, xx, yy, SWF_INST_DATA.Get(“ID_PERSON”))
Return(M4_SUCCESS)
Where xx and yy indicate the sub-module and number of the message to be issued.
[Workflow] Identify Existing Instance
This API returns the number of active instances of a given BPC that match the passed variables.
The details related to each workitem are provided in the main node of the Meta4Object (one record per workitem). The method Get Value can be used to identify the value of the BPC variables. If the state is not linked to the current user, the workitem has the value “N/A”.
It can be used, e.g. in the Hire to identify if a person is involved in a recruitment process and should not be hired yet because of pending approval or because the task to hire the person is assigned to a different user.
Technical details
The details related to each workitem are provided in the main node of the Meta4Object (one record per workitem). The method Get Value can be used to identify the value of the BPC variables. If the state is not linked to the current user, the workitem has the value “N/A”.
It can be used, e.g. in the Hire to identify if a person is involved in a recruitment process and should not be hired yet because of pending approval or because the task to hire the person is assigned to a different user.
Technical details
- Meta4Object: SWF_INSTANCE
- Node Structure: SWF_INSTANCE
- Method: GET_INSTANCES (ARG_ID_BPC, tuples ID Variable / Value)
Returns number of instances of the given BPC that match the variables.The workitems can be retrieved from the property ID_WORKITEM (if the task is assigned to the current user, otherwise is the value “N/A”). - Method: GET_VALUE (ARG_ID_VARIABLE)
Returns the value of the given variable for the currently positioned record.
[Workflow] Range for Auto-Numeric IDs
All elements of the workflow (states, transitions, events, and so on) use auto numeric ids. To avoid conflicts upon updates, the following ranges have been established and should be respected.
Range for IDs (Application Parameter: Mind / Version / Range)
0000 – 0499: Existing
0500 – 0999: Technology
1000 – 1999: Corporate
2000 – 2199: France
3800 - 3999: Spain (private sector)
4000 – 4199: Spain (public sector)
2200 – 7999: Other countries
8000 – 9999: Client
Note: The default value of these application parameters corresponds to the range of the client.
Range for IDs (Application Parameter: Mind / Version / Range)
0000 – 0499: Existing
0500 – 0999: Technology
1000 – 1999: Corporate
2000 – 2199: France
3800 - 3999: Spain (private sector)
4000 – 4199: Spain (public sector)
2200 – 7999: Other countries
8000 – 9999: Client
Note: The default value of these application parameters corresponds to the range of the client.
Wednesday, 16 July 2008
Dump Presentation (OBL) to File

From developer taskbar run: ID_PRESENTATION,s:C:\FILE.OBL
ID_PRESENTATION: ID of presentation
C:\FILE.OBL: Output file including path (extension is not fixed)
Example:
SRCO_PA_MN_HIRE,s:c:\obl\SRCO_PA_MN_HIRE.obl
Subscribe to:
Posts (Atom)