0 votes
937 views
in Coach Views by

1 Answer

0 votes
by (30.6k points)

A coach or human service opens in its own window when you open its URL with window.open - the human service must be reachable by URL, which is the case for tasks (task URL) and for services exposed as startable (start URL):

// coach view / button handler: open a startable human service in a new window
var url = "/teamworks/executecf?modelID=1.4c1c...&branchID=2063.9a2b...";    // from the service's "Overview > Expose > URL" (Process Center: branch; Process Server: snapshotID=... instead of branchID)
window.open(url, "_blank", "width=1000,height=800,menubar=no,toolbar=no");

// open a task
window.open("/ProcessPortal/launchTaskCompletion?taskId=" + taskId, "_blank");           // 8.5.7+ portal URL
// or the raw coach URL: "/teamworks/process.lsw?zWorkflowState=1&zTaskId=" + taskId

// pass data: startable services take input variables as URL parameters (tw.local.orderId): ...&tw.local.orderId=42
// on CP4BA prefix the instance path (e.g. /baw/bawins1) - derive it from window.location.pathname

Getting data back: the popup can call window.opener (same origin) - e.g. window.opener.postMessage({ orderId: 42 }, "*") when it finishes, and the parent coach listens with window.addEventListener("message", ...) and refreshes; or the popup simply runs its own service and the parent reloads on focus. Alternatives that keep the user in one page: a UI Toolkit Modal Section containing the same coach views (no separate service), or an IFrame view with the service URL inside a modal. Browser pop-up blockers allow window.open only inside a click handler - not from a load event.

References

Related questions

0 votes
1 answer 1.6k views
0 votes
1 answer 1.2k views
0 votes
1 answer 1.0k views
0 votes
1 answer 1.1k views
0 votes
1 answer 2.1k views
0 votes
1 answer 1.6k views
0 votes
1 answer 668 views
0 votes
1 answer 2.4k views
0 votes
2 answers 2.9k views
0 votes
1 answer 1.8k views
0 votes
1 answer 673 views
0 votes
1 answer 1.7k views
0 votes
1 answer 1.7k views
0 votes
1 answer 1.3k views
0 votes
1 answer 1.9k views

723 questions

807 answers

98 comments

4.9k 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
...