This solution worked for us. It allows us to see what user is logged in --and-- what Maximo environment Anywhere is connected to.(I wasn't the one who implemented it, so the end solution might have varied slightly.)
1. Stop Maximo Anywhere server.
2. Open MobileFirstStudio eclipse to modify the xml of Technician (Work Execution) application UI. Eclipse will build the app after changes.
3. Go to this path in project in eclipse:
MximoAnywhewre->apps->WorkExecution->artifcat->app.xml
4. Comment out/remove previously provided <view> tag. (i.e. <view id="WorkExecution.UserInfoView" label="Logged-In User".....)
5. Add new 'view' to display the current logged user along with environment name.
- Search for <ui id="ui">
- There will be multiple <view> tags, which display different sections in UI.
- To display logged in user & env, we will add new view.
6. Add below view code after <ui> tag
<view id="WorkExecution.UserInfoView" label="User-Env Details">
<requiredResources id="WorkExecution.userInfoView_requiredResources">
<requiredResource id="WorkExecution.userInfoView_userInfo" name="userInfo"/>
<requiredResource id="WorkExecution.userInfoView_userInfo_1" name="oslcmaxvars1"/>
</requiredResources>
<container id="WorkExecution.UserInfoView_userInfo_container_0" resource="userInfo">
<group id="WorkExecution.UserInfoView_group_0">
<groupitem id="WorkExecution.UserInfoView_userInfo_groupitem_WorkExecution.LoggedinuserView">
<text id="WorkExecution.UserInfoView_userInfo_groupitem_0_loggedinuser" resourceAttribute="loginid" label="User" editable="false" placeHolder="Tap to enter"/>
</groupitem>
</group>
</container>
<container id="WorkExecution.UserInfoView_userInfo_container_1" resource="oslcmaxvars1">
<group id="WorkExecution.UserInfoView_group_1">
<groupitem id="WorkExecution.UserInfoView_userInfo_groupitem_WorkExecution.LoggedinuserView_1">
<text id="WorkExecution.UserInfoView_userInfo_groupitem_0_loggedinuser_1" resourceAttribute="varvalue" label="Environment" editable="false" placeHolder="Tap to enter"/>
</groupitem>
</group>
</container>
</view>
7. Add below 'resource' tag to fetch environment value from maxvars. (We will be doing one record insert in MAXVARS table for environment name)
- Search for <data id="data">
- There will be multiple <resource> tags.
- Add below code after <ui> tag.
<resource describedBy="http://[your maximo url]#MaxVars" id="oslcmaxvars1" isSystem="true" name="oslcmaxvars1" pageSize="200" providedBy="/oslc/sp/[your path]" refreshOnLogin="true">
<attributes id="oslcmaxvars1_attributes">
<!-- limits the scope of attributes used from full Work Order RDF -->
<attribute describedByProperty="spi:varname" id="oslcmaxvars1_varname_spivarname" index="true" name="varname"/>
<attribute describedByProperty="spi:varvalue" id="oslcmaxvars1_varvalue_spivarvalue" name="varvalue"/>
<attribute describedByProperty="spi:orgid" id="oslcmaxvars1_orgid_spiorgid" name="orgid"/>
<attribute describedByProperty="dcterms:identifier" id="oslcmaxvars1_identifier_dctermsidentifier" name="identifier"/>
</attributes>
<queryBases id="oslcmaxvars1_queryBases">
<queryBase id="oslcmaxvars1_queryBase_getmaxvarsinprglabtrans" name="getMaximoEnv" queryUri="/oslc/os/oslcmaxvars"/>
</queryBases>
<whereClause clause="spi:varname in ['MAXIMO_ENV']" id="oslcmaxvars1_whereClause"/>
</resource>
8. Make new var entry in MAXVARS table. Run below sql scripts. (Attribute 'VARVALUE' to be provided as per environment i.e. DEV/TEST/PROD)
REM INSERTING into MAXVARS
SET DEFINE OFF;
Insert into MAXVARS (VARNAME,VARVALUE,ORGID,SITEID,MAXVARSID,VARTYPE) values ('MAXIMO_ENV','DEV',null,null,maxvarsseq.nextval,'SYSTEM');
commit;
9. Save the xml.
10. Start the server.
1. Stop Maximo Anywhere server.
2. Open MobileFirstStudio eclipse to modify the xml of Technician (Work Execution) application UI. Eclipse will build the app after changes.
3. Go to this path in project in eclipse:
MximoAnywhewre->apps->WorkExecution->artifcat->app.xml
4. Comment out/remove previously provided <view> tag. (i.e. <view id="WorkExecution.UserInfoView" label="Logged-In User".....)
5. Add new 'view' to display the current logged user along with environment name.
- Search for <ui id="ui">
- There will be multiple <view> tags, which display different sections in UI.
- To display logged in user & env, we will add new view.
6. Add below view code after <ui> tag
<view id="WorkExecution.UserInfoView" label="User-Env Details">
<requiredResources id="WorkExecution.userInfoView_requiredResources">
<requiredResource id="WorkExecution.userInfoView_userInfo" name="userInfo"/>
<requiredResource id="WorkExecution.userInfoView_userInfo_1" name="oslcmaxvars1"/>
</requiredResources>
<container id="WorkExecution.UserInfoView_userInfo_container_0" resource="userInfo">
<group id="WorkExecution.UserInfoView_group_0">
<groupitem id="WorkExecution.UserInfoView_userInfo_groupitem_WorkExecution.LoggedinuserView">
<text id="WorkExecution.UserInfoView_userInfo_groupitem_0_loggedinuser" resourceAttribute="loginid" label="User" editable="false" placeHolder="Tap to enter"/>
</groupitem>
</group>
</container>
<container id="WorkExecution.UserInfoView_userInfo_container_1" resource="oslcmaxvars1">
<group id="WorkExecution.UserInfoView_group_1">
<groupitem id="WorkExecution.UserInfoView_userInfo_groupitem_WorkExecution.LoggedinuserView_1">
<text id="WorkExecution.UserInfoView_userInfo_groupitem_0_loggedinuser_1" resourceAttribute="varvalue" label="Environment" editable="false" placeHolder="Tap to enter"/>
</groupitem>
</group>
</container>
</view>
7. Add below 'resource' tag to fetch environment value from maxvars. (We will be doing one record insert in MAXVARS table for environment name)
- Search for <data id="data">
- There will be multiple <resource> tags.
- Add below code after <ui> tag.
<resource describedBy="http://[your maximo url]#MaxVars" id="oslcmaxvars1" isSystem="true" name="oslcmaxvars1" pageSize="200" providedBy="/oslc/sp/[your path]" refreshOnLogin="true">
<attributes id="oslcmaxvars1_attributes">
<!-- limits the scope of attributes used from full Work Order RDF -->
<attribute describedByProperty="spi:varname" id="oslcmaxvars1_varname_spivarname" index="true" name="varname"/>
<attribute describedByProperty="spi:varvalue" id="oslcmaxvars1_varvalue_spivarvalue" name="varvalue"/>
<attribute describedByProperty="spi:orgid" id="oslcmaxvars1_orgid_spiorgid" name="orgid"/>
<attribute describedByProperty="dcterms:identifier" id="oslcmaxvars1_identifier_dctermsidentifier" name="identifier"/>
</attributes>
<queryBases id="oslcmaxvars1_queryBases">
<queryBase id="oslcmaxvars1_queryBase_getmaxvarsinprglabtrans" name="getMaximoEnv" queryUri="/oslc/os/oslcmaxvars"/>
</queryBases>
<whereClause clause="spi:varname in ['MAXIMO_ENV']" id="oslcmaxvars1_whereClause"/>
</resource>
8. Make new var entry in MAXVARS table. Run below sql scripts. (Attribute 'VARVALUE' to be provided as per environment i.e. DEV/TEST/PROD)
REM INSERTING into MAXVARS
SET DEFINE OFF;
Insert into MAXVARS (VARNAME,VARVALUE,ORGID,SITEID,MAXVARSID,VARTYPE) values ('MAXIMO_ENV','DEV',null,null,maxvarsseq.nextval,'SYSTEM');
commit;
9. Save the xml.
10. Start the server.


#AssetandFacilitiesManagement#Maximo#MaximoAnywhere