Workplace Integration

Workplace Integration Guide

Since v2024.04.4.0 GWE allows you to create and manage workflow requests directly from Workplace.
The integration between GWE and Workplace requires a few manual steps which we will go through in detail below.

ℹ️

Note: If you have not made any modifications to the OOB Workplace source code in your project you can just copy, paste & replace all files from the schema/ab-products/essential directory of the kit into the schema/ab-products/essential directory of your project.

Prerequisites

This operation will require you to run 2 build commands: one for Workplace itself and one for GWE.
For this you will need two things:

  1. NodeJs

The NodeJs version may differ depending on your ARCHIBUS version.
e.g. ARCHIBUS v2024.04.01.115 requires NodeJs v20.13.1

To know which version of node you need, head over to schema/ab-products/essential/dev/workplace/package.json, open the file and look for the engines property at the very end.
e.g.

package.json
"engines": {
  "node": "20.13.1"
}
ℹ️

Tip: The easiest way to use one or more NodeJs versions is to do it via the node version manager for Mac/Linux also known as nvm.
For Windows there is Corey Butler’s nvm-windows which serves the same purpose.

  1. Yarn

By default, NodeJs comes packed with npm (node package manager) to install dependencies for your projects.
However we will use a different package manager for our build process: yarn because npm is slower, not as good at figuring out mismatching dependency versions and it’s what ARCHIBUS uses to build the Workplace app.

With NodeJs installed, open a terminal and install it with the following command:

npm install --global yarn

If everything went well you should be able to see the yarn version when you write:

yarn --version

Installing the integration

With the prerequisites installed, we can go ahead and rebuild the Workplace sources with the GWE modifications.

Copy the new files

Inside the unarchived GWE kit you will find the following files and directories that need to be copied at their corresponding locations in your ARCHIBUS project directory.

              • baseGWE.config.js
              • devGWE.config.js
              • prodGWE.config.js

Note: The schema\ab-products\essential\dev\workplace\gwe directory needs to be copied in its entirety.

Patch OOB files

Certain OOB files need to be modified in order to display GWE’s Create / Management views.
We’ll begin with the package.json file that needs to incude the GWE build scripts.
Copy and paste the highlighted lines in the OOB files.

schema/ab-products/essential/dev/workplace/package.json
"scripts": {
  "test": "jest",
  "webpack": "webpack",
  "develop": "npm run webpack -- --mode development --config webpack/dev.config.js --env PLATFORM=local --env VERSION=stag",
  "production": "npm run webpack -- --mode production --config webpack/prod.config.js --env PLATFORM=local --env VERSION=stag --env patch",
  "watch": "npm run webpack -- --watch --config webpack/dev.config.js --env PLATFORM=local --env VERSION=stag",
  "extractlocalizedstrings": "node scripts/extract-localized-strings.js",
  "format": "npm run prettier -- --write",
  "prettier": "prettier \"**/*.+(js|jsx|css)\"",
  "lint": "eslint src",
  "validate": "npm run lint && npm run prettier -- --list-different",
  "storybook": "start-storybook -s ./src/assets/img -p 9001 -c .storybook",
  "build": "npm run production && npm run extractlocalizedstrings",
  "scriptsComment": "echo 'scripts -> `test`, `webpack` and `storybook` are not in use currently.'",
  "prepare": "cd ../../../../.. && husky schema/ab-products/essential/dev/workplace/.husky",
 
  "lintGWE": "eslint --ext .js,.jsx,.css ./gwe",
  "developGWE": "webpack --mode development --config webpack/devGWE.config.js --env PLATFORM=local --env VERSION=stag",
  "watchGWE": "webpack --watch --config webpack/devGWE.config.js --env PLATFORM=local --env VERSION=stag",
  "productionGWE": "npm run webpack -- --mode production --config webpack/prodGWE.config.js --env PLATFORM=local --env VERSION=stag --env patch",
  "buildGWE": "npm run productionGWE && npm run extractlocalizedstrings"
},

Build Workplace

Open up a terminal in schema/ab-products/essential/dev/workplace and run the following command:

yarn build

Wait for the process to finish.
After that it’s time to build the GWE app:

yarn buildGWE

With this last step you have finished building the integration.

Using the integration

Now that the integration is installed you can test it by setting the Use in Workplace field to true when defining / editing a management view.

Smart Services / Workflow Engine / Define Management Views

img

To try it out, create a new management view or select an existing one and switch the Use in Workplace to Yes.
Two additional fields will appear: Workplace Image and Workplace Description.

Workplace Configuration

img

💡

Caveat 1: The image must have an aspect ratio of 3:2 to match the OOB ones.

💡

Caveat 2: Updating an image will have no effect if the updated image has the same file name as the previous one. This is due to the fact that Workplace caches its images inside \schema\ab-products\essential\workplace\tmp\images. If you want to see the changes, you must manually delete the cached image from the directory.

With the field set to Yes just click on Design to save the form values and then you can open the Workplace application. You should see your bucket alongside the OOB ones.

img

Clicking on it will open a view with two tabs: Create and Manage.

img

You can also create requests by switching to the Create tab.

img