OSCM Approval Tool
Run maven on the parent pom
mvn clean package
Check the result, <projectroot>/target/approval-impl-0.0.2-SNAPSHOT.war
Check the logs, e.g. the ApprovalNotificationService is well deployed:
31-Jul-2020 15:18:55.211 INFO [localhost-startStop-1] org.apache.openejb.server.webservices.WsService.afterApplicationCreated Webservice(wsdl=http://localhost:8880/approval/ApprovalNotificationService, qname={http://oscm.org/xsd}ApprovalNotificationService) --> Pojo(id=localhost.approval.org.oscm.app.approval.triggers.ApprovalNotificationService)
31-Jul-2020 15:18:55.218 INFO [localhost-startStop-1] sun.reflect.DelegatingMethodAccessorImpl.invoke Deployment of web application archive [/opt/apache-tomee/webapps/approval.war] has finished in [7,287] ms
- Log in to the Administration portal (
oscm-portal
) as an administrator of a supplier organization, who also has the service manager and technology manager role. - Import the technical service template for the approval tool.
- Create a free marketable service for the approval tool and publish it on the supplier's marketplace. For details about publishing services in OSCM, refer to the Supplier's Guide.
- Register a new customer and a technical user with the administrator role in this organization. Note the credentials of the user and the customer organization ID.
- Create the following custom attributes:
Approver Organization
Key: APPROVER_ORG_ID_<CUSTOMER ORG>
Value: <ORG ID>
User Option: false
Where <CUSTOMER ORG>
is the organization ID of the customer, and <ORG ID>
is the ID of the approver organization.
Trigger User Key
key: USERKEY_<CUSTOMER ORG>
Value: <USER KEY>
User Option: false, Encryped: false.
Where <CUSTOMER ORG>
is the organization ID of the customer, and <USER KEY>
is the key of the technical user in the customer organization.
Trigger User ID
key: USERID_<CUSTOMER ORG>
Value: <USER ID>
User Optis ion: false, Encryped: false
Where <CUSTOMER ORG>
is the organization ID of the customer, and <USER ID>
is the ID of the technical user in the customer organization.
Trigger User Password
key: USERPWD_<CUSTOMER ORG>
Value:<PWD>
User Option: false, Encryped: true
Where <CUSTOMER ORG>
is the organization ID of the customer, and <PWD>
is the password of the technical user in the customer organization. The value stored is encrypted.
- Log in as a customer administrator to the marketplace.
- In Account > Processes, define the following trigger:
Type: Subscribe to Service
Target type: Web Service
Target URL: http://oscm-app:8880/approval/ApprovalNotificationService?wsdl
Suspend: Yes (enable the checkbox)
- If not done, deploy the Sample Controller in the
oscm-app
container and create a corresponding service. - Subscribe to the service. The subscription is suspended with a trigger message.
- Log in to
https://<FQDN>/approval/
as an administor of the defined approver organization. - Check the task list that appears, and select the task for the new subscription.
- Enter a comment and reject or accept the subscription.
- Go back to the subscription on the OSCM marketplace and check the resulting status.
- Check the inbox at
http://<FQDN>/mail
for emails related to the approval of the subscription.
You can customize the appearence and content of the approval request emails which are sent to the approver.
Proceed as follows:
-
Download the email template from the GitHub repo.
-
Edit the HTML content as desired. Use inline CSS as desired.
-
The following placeholder variables are available:
$(mail.body), $(service.name), $(service.technicalId), $(service.price.text), $(service.price.type), $(service.price.freePeriod), $(service.price.oneTimeFee), $(service.price.currency), $(user.orgId), $(user.email), $(user.firstname), $(user.lastname), $(user.key)
.
The notification service will fill in the placeholders with the respective data retrieved from the subscription trigger. -
Open
https://<FQDN>/oscm-app-approval
. -
Log in as a service manager of the supplier organization.
-
Use the Import option in the Service templates section to upload your HTML email template.
All subsequent approval requests will use the new email template. To test it, take the steps described above.
- Use
docker logs -f oscm-app
- Connect to the approval database with PGAdmin and check the created data, particularly the user IDs.
Have fun!