Sunday, August 30, 2009

Table Column Sort type settings

Have you ever had to show a string attribute in a table as a column, and had to sort it as a numeric value.??

If yes, you will know, that when sorting this column, you see that numbers get sorted as alphabets. Here is what i mean. If you have the values, 1,12,15,23,103, this will be order in which the number will appear after the sorting in ascending order, 1,12,15,103,23.

This happens because the numbers are treated as alphabets and since 2 is greater than 1, 23 is displayed last.

How to fix this????

Obviously we have to make sure that the values are treated as numbers and not alphabets while sorting happens.
The way to do this is to modify the table column definition and add a property "sorttype" to the column. Here is the mql to modify the existing table definition.

modify table system column modify add property "sorttype" "numeric" ;


Make sure to reload cache after executing this mql ..

Friday, July 17, 2009

CaseSensitive settings

Searchs in enovia are by default Case Sensitive.
Imagine the pain of the end user when trying to search for a person's userid if the users are named in mixed case eg: username "Mike Smith" and userid "mSmith".
Same goes for trying to find a person with last name "O'Connell", you never know if the name was entered as "o'Connell" or "O'connell" or "o'connell".

Thankfully, we can enable and disable "case sensitivity" in enovia according to our needs.

Below are the MQL statements to enable and disable case sensitivity.

set system CaseSensitive On;
set system CaseSensitive Off;

Please be aware that this is a system level settings, and the decision to enable or disable should be taken in the initially stages of the implementation.

if you have any questions regarding this post, Please let me know.

Wednesday, July 8, 2009

Trigger configuration for attribute value validation

There is a OOTB tcl (eServicecommonTrigcAttribute_if.tcl) which can be configured to validate attributes on promote action / check events. Below are the parameters

attribute[eService Program Argument 2].value = UNASSIGNED,UNASSIGNED
attribute[eService Program Argument 1].value = attribute_ResponsibleDesignEngineer,attribute_ResponsibleManufacturingEngineer
attribute[eService Program Name].value = eServicecommonTrigcAttribute_if.tcl

Thursday, June 18, 2009

MQL Statements for Server Administrators

Given below are the some mql statments that can used to understand the status of the enovia server.

  • This command will be helpful in understanding which users are currently using the enovia database. This command will tell you the user and machine and the process that is being used to connect to the enovia data base.
MQL Stmt
sessions;
  • The output of this command will be in the following format
  • USERNAME MACHINENAME PROGRAMNAME


  • This next command will be helpful in understand the memory status of the enovia server at any given point in time.
MQL Stmt
monitor memory;
  • The output of this command will be in the following format.
Used heap 32822573 bytes, free heap 441200 bytes.

Matrix Memory Manager:

31703941 bytes of memory allocated in 2783 blocks, highwater= 31885325 bytes
27754496 bytes of memory reserved in 1694 blocks
JVM total memory: 63778816
JVM max memory: 66650112
JVM free memory: 36291952
JVM memory in use: 27486864
JVM available processors: 2

MQL Enchancements

  • Modify bus statement has some enhancements, One the of the enhancements is given below. I think this one will be helpful in data migration scripts mostly, but i am sure we will find other uses for this too.MQL Stmt
modify bus current "";
  • Triggers do not fire.
  • History records are not added.
  • No signature affected.

  • MQL Statement "temp query bus" has and new clause with new operators. i think this will be help full for us when we want to show list of objects in particular order(Sorting)
MQL Stmt
temp query bus orderby -type orderby name order +attribute[Color];
  • - for descending + for ascending.

  • Finally an MQL Statment to query connections. I think this MQL statement has been awaited for a long time. Using this mql statement we can query for the connection objects and the attributes in the connections much easier.

MQL Stmt
query connection to "Project Space" "TestProj" 21240970107702 select id;
query connection [type PATTERN];
  • There are many more different options that can be used with this statement. For more information: "help connection" on mql prompt.

Tuesday, June 9, 2009

Using "const" for reserved words in SEARCHES

Reserved words such as keywords and select expressions must be afforded special consideration in exact equal (==) Matrix expressions. For example, the following statement might be written to find business objects where the value of the attribute ‘Regression’ is ‘first’.
where 'attribute[Regression]==first';

But because ‘first’ is a select keyword that returns the first revision of a business object and is evaluated as such, the result of the evaluation — rather than the literal word ‘first’— is compared with the attribute.

For this type of situation, use const to indicate that whatever follows should not be evaluated.

For example: where 'attribute[Regression]==const"first"';

Const has three possible forms: all uppercase, all lowercase, and initial letter capitalized followed by all lowercase. No space can appear after the word const. It must be followed by a quote (double or single, depending on the syntax of the rest of the statement). Almost any character can appear within the quotes, with the exception of backslash and pound sign. The characters between the initial and closing quotes remain unevaluated.

If your implementations are using JSP/Tcl to compose a where clause dynamically (that is, using a variable to construct the where clause), the const syntax must be used because the value you pass in could be a ENOVIA Collaboration Platform keyword. If this happens, the where clause will not return an error, but you will get unexpected results.
Here are some examples of queries that will NOT return correctly without using const:

attribute[Some Attribute]==‘first’
attribute[Some Attribute]==‘FIRST’
attribute[Some Attribute]=="Current"
attribute[Some Attribute]=="owner"
description=="Current"
description=="policy"

However, the following will return correctly:

attribute[Some Attribute]==‘my first order’
attribute[Some Attribute]~=‘*first*’

Friday, May 29, 2009

Default User Name on LoginScreen for Business Matrix or System

Have you ever been annoyed that every time you open enovia's "Business", "Matrix" or "System", you have to remove the name which is by default your login id and replace it with creator.

Its time to stop being annoyed, here is a solution for that problem.

Open your Matrix.ini file which is present by default in C:/Windows.
Add the following line to it.

USER=creator

What is this setting doing??
This setting is telling the applications (Business,Matrix, and System) to use creator as the default user name.


Hope this will save some time for all of you ...

Tuesday, May 26, 2009

Type Ahead (Auto Complete) in UI Webforms / Tables

Today I would like to share Matrixone's Type Ahead feature a feature very much similar to Google's Auto Complete.

The Type Ahead feature stores text values entered in form text fields, then displays the most recent entries the next time that the user enters that field. They can then select from the list rather than needing to type the complete value or use a chooser.

If the field uses a JPO:method, the functionality is slightly different. The field pops up the list of recently-entered values as described above. When the user types something that does not match any of those values and exceeds the character count setting, the JPO is triggered to return the list of matching values returned by the JPO method.

Below are the UI field settings:

· TypeAhead=true|false Enables type ahead. If not provided, automatically set to true. Typically used to disable type ahead for a field.
· TypeAhead Program—Name of the JPO called to retrieve a list of possible values. This JPO is called after the user types the specified number of characters. A JPO is typically used by fields that are normally populated using choosers.
· TypeAhead Function—The name of the JPO method used in conjunction with the TypeAhead Program setting.
· TypeAhead Character Count—Overrides the emxFramework.TypeAhead.RunProgram.CharacterCount system property. This setting may be useful for fields whose values may all contain the same prefix.
· TypeAhead Saved Values Limit—Overrides the emxFramework.TypeAhead.SavedValuesLimit system property

The configured TypeAhead program should extend emxTypeAhead and the function should have the below format

public String test(Context context, String[] args) {
String filter = args[0];

addValue("first", "hidden_first");
addValue("second", "hidden_second");
addValue("third", "hidden_third");
setAllDataSentAttribute(true);
return (toXML());
}

This Type Ahead feature is implemented using the Matrix Cue objects which are context specific just like the sets, so the stored / returned values are also specific to the context user. The number of values stored for each user per field depends on the value for the emxFramework.TypeAhead.SavedValuesLimit property in the emxSystem.properties file. The default is 10 unique values and can be overridden at the field level using the Type Ahead Saved Values Limit setting.

This Type Ahead feature can also be implemented in custom forms using framework’s tag library, please refer to the app dev guide for more details.

Thursday, May 21, 2009

Dynamic Columns in UI Table

Discussed here is the UI Table feature that was introduced recently into enovia.

Have you ever run into a situation where the requirement said that the display screen should have multiple columns depending on the input, and we had to write a JSP to implement this, because UI Table could not display multiple columns depending on the input?

This kind of requirement can be implemented using dynamic columns feature in UI Table.

Dynamic Columns in UI Tables

Traditionally we used to define a certain number of columns in the UI Table definition, and all those columns were displayed on the screen.
With dynamic columns feature we can define the number of columns displayed on the screen , on the fly using a JPO.
Here is how you define a dynamic column

UI Table column definition.
• Column Type = Dynamic
• Dynamic Column Program = JPO name
• Dynamic Column Function = JPO method name
In this JPO Method you can define the # of columns that will be displayed on the screen.
The output of this column to should be a Maplist, that will contain the # of maps that is same as the # of columns you want to display.
The format of the Map per column is given below.

if colMap is the Map for one column, then at a minimum the Map should contain.

colMap.put("name", "<Name of the Column>" );
colMap.put("label", "<Lable for the Column>" );
colMap.put("settings",<Map with the settings for the column>);

example for settings Map:

settingsMap.put("Registered Suite","Framework");
settingsMap.put("Admin Type","Type");
settingsMap.put("Target Location","content");


Please let me know if you have any questions.

UI Table Validations



Basically this is explaining how to do validations on tables.

Last week I had to do number validation on a emxTable edit to allow user only to key in values between 1-999. Initially thought of handling it with the attribute range but it becomes a huge drop down to choose from, that is when I opted for custom JavaScript validation on edit table (this valid for forms)

Below is a quick summary of the implementation:

1. You can use a custom JavaScript method to validate any field when it is displayed in Edit mode and the Editable setting is true. The method name is configured for the field with the Validate=methodName in table setting. The method can refer to the control with the keyword “this”.
2. For example, for a field with the Validate=validatePortfoilioPriority setting, the system calls the validatePortfoilioPriority () JavaScript function (shown below).

The function must return true for successful validation.


// JavaScript
function validatePortfoilioPriority() {
if(condition) {
} else (condition) {
}
return true;
}


3. Add this function to any JavaScript file or any JSP file. Make sure the name of the file is specified in emxSystem.properties file with the key SUITEKEY.UIForm.ValidationFile. You can assign one or more
files (separated by a comma) as the property value.

eServiceSuiteProgramCentral.UIForm.ValidationFile = scripts/bcValidation.jsp
You can assign one or more files separated by a comma as the property value
Please refer to Enovia Matrixone Application Development Guide for more detailed information.



Note: For reference just sees the “bcProjectDashboardEditTable” table in clear case (spinner/programcentral/business) and the method what I wrote is put in “bcUIFormValidation.jsp” in programcentral. And search for the fallowing line

“eServiceSuiteProgramCentral.UIForm.ValidationFile = emxProgramCentralUIFormValidation.jsp,bcUIFormValidation.jsp” in emxSystem properties file. This is the way we have to give the name of the file in emxSystem Properties file.