0 votes
12 views
ago by (30.6k points)
We want some tasks of a BPD to be worked in another application (a custom portal or a mobile app) instead of a coach. BAW has "External implementation" as an activity type. How does it work end to end and what does the external side have to call?

1 Answer

0 votes
ago by (30.6k points)

An External Implementation is an activity implementation with an input / output contract but no UI: BAW creates a task as usual (assigned to a team, visible in the task list, with due date and priority) and the process waits until an external application finishes the task through the REST API.

# 1. process app: External Implementation "Approve in Portal" with inputs (order) and outputs (decision, comment); a BPD activity uses it, assigned to team Approvers
# 2. external app - find open external tasks (as the user, or as an administrator with filterByCurrentUser=false)
PUT /rest/bpm/wle/v1/search/query?organization=byTask&run=true&size=50&condition=taskStatus%7CReceived&condition=taskActivityName%7CApprove%20in%20Portal
# 3. read the task's input data and the external activity ids
GET /rest/bpm/wle/v1/task/2078.911?parts=data      -> data.variables.order, externalActivityID, externalActivitySnapshotID
# 4. the contract (input/output schema) of the external activity, for a generic form renderer
GET /rest/bpm/wle/v1/externalactivity/60.0b902a52-8df2-44ed-85e2-04bbd980b01d/model?snapshotId=2064.abc...
# 5. claim and complete with output data
PUT /rest/bpm/wle/v1/task/2078.911?action=assign&toMe=true&parts=none
PUT /rest/bpm/wle/v1/task/2078.911?action=finish&parts=none&params={"decision":"APPROVED","comment":"ok"}
BPMCSRFToken: <token from POST /system/login>

Portal patterns: the external app polls the search, or is notified (a system-lane step that sends a message with the task id to the app, or BAI events); it presents the data in its own UI and finishes the task; the process continues immediately. Coaches and external implementations can be mixed per activity, so a mobile app can handle only the approval steps. On CP4BA the calls are the same with a Zen API key; Workplace lists the external task but cannot open it - keep such tasks in teams that do not use Workplace, or hand them to an Application Designer page.

Alternative without an external implementation: a normal coach task that your app completes through the same finish call - possible, but then Workplace users could also open the coach; the external implementation makes the contract explicit and validates the output data against it.

References

Related questions

0 votes
1 answer 1.0k views

723 questions

807 answers

98 comments

4.8k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...