Skip to content

Enable Bypass functionality in Active Workspace

Notifications You must be signed in to change notification settings

ActiveWorkspaceExtensions/bypass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Active Workspace Bypass Customization

Version 1.1 Release Notes

  • Added command to the Global Navigation toolbar

Images

  • Added supporting icon images to image which will be included in deployment.

Commands View Model

Commands

  • enableBypassCommand image
  • disableBypassCommand image

Command Handlers

  • Handlers call an action to either enable or disable bypass.

Command Placements

  • Both enable/disable bypass are located on the aw_globalNavigationbar uiAnchor.

Actions

  • enableBypass: SOA service to setUserSessionState value to 1 and subsequent event to reload page allowing refresh of ViewModel object permissions.

  • disableBypass: SOA service to setUserSessionState value to 1 and subsequent event to reload page allowing refresh of ViewModel object permissions.

On Event

    "onEvent": [
        {
            "eventId": "enableBypass.reload",
            "action": "reloadPage"
        },
        {
            "eventId": "disableBypass.reload",
            "action": "reloadPage"
        }
    ]

Conditions

"conditions": {
    "showEnableBypass": {
        "expression": " ctx.userSession.props.group_name.dbValue=='dba' && ctx.userSession.props.role.uiValue=='DBA' && ctx.userSession.props.fnd0bypassflag.dbValues[0] === '0'"
    },
    "showDisableBypass": {
        "expression": "ctx.userSession.props.group_name.dbValue=='dba' && ctx.userSession.props.role.uiValue=='DBA' && ctx.userSession.props.fnd0bypassflag.dbValues[0] === '1'"
        }
    }

Overview

Customization to disable the rule tree. This gives unrestricted access to objects in Active Workspace.

Deployment Instructions

Source Code Deployment

Copy and Paste the \src directory into %TC_ROOT%\aws2\stage, then run the following commands in a Teamcenter command terminal:

cd %TC_ROOT%\aws2\stage
initenv.cmd
awbuild.cmd

Stylesheet Modifications

Modify the Awp0UserSummary stylesheet using either the Rich Client or XRTEditor in Active Workspace.

A sample of this stylesheet has been included in the solution media.

Add the following section to the stylesheet to expose the Bypass Flag checkbox in the User summary stylesheet.

<section titleKey="Bypass" >
    <htmlPanel declarativeKey="bypass" />
</section>

Validation

  • Login to the Active Workspace Client after successfully running the awbuild.cmd.
  • Find an object which the logged in user does not have write access to (Example in video of an object with Obsolete status)
  • Verify that the EditStart Edit command is not available when selecting the object.
  • Select on the icon in the bottom left corner of the client, then select Profile.
  • Select the aw-checkbox labeled Bypass Flag to enable the bypass feature.
  • Navigate back to the object and verify EditStart Edit is now available and changes can be made to the object properties.
  • To disable Bypass, navigate back to Profile and uncheck the aw-togglebutton.
_Bypass.mp4

Solution Definition

View

Elements

  • aw-panel
  • aw-panel-section
  • aw-togglebutton
  • visible-when

Conditions

  • Group: dba (ctx.userSession.props.role.uiValue=='DBA')
  • Role: DBA (ctx.userSession.props.role.uiValue=='DBA')
  • Location: User Profile (ctx.userSession.props.user.dbValue==ctx.selected.uid)

View Model

Imports

"js/visible-when.directive",
"js/aw-togglebutton.directive",
"js/aw-panel.directive",
"js/aw-panel-section.directive"

Actions

"toggle": {
    "actionType": "TcSoaService",
    "serviceName": "Core-2007-12-Session",
    "method": "setUserSessionState",
    "inputData": {
        "pairs": [{
            "name": "fnd0bypassflag",
            "value": "{{(ctx.userSession.props.fnd0bypassflag.dbValue) ? '1' : '0'}}"
        }]
    }
}

SOA

image