0
votes

Suppose I have one flow with 2 tasks. In task1 I call one client-side human service with a coach created by pure Custom HTML other than those elements provided by BPM itself. I have a button in this Custom HTML, my question is:

1) How can I finish this coach(make flow goes to end just like you click the button BPM provided) by clicking this button? Is there any rest api I can use? I found that I can call /rest/bpm/wle/v1/task/{taskId}?action=finish to end task1, but how can I interact with the client-side human service inside task1?

2) Is my use case(use pure Custom HTML, by doing this front end guy can still focus on HTML, CSS which they used to do) a good practice?

2

2 Answers

1
votes

perform :

tw.system.findTaskByID(taskID).complete(user, outputValues) ;

on onClick of the button inside Custom HTML Coach.

If you are unable to use tw. variables inside Custom HTML , use Server Scriptlet and copy paste your code from Custom HTML to it.

1
votes

One of the most powerful aspects of BPM is that we can use it to compartmentalize parts of HTML, CSS & JS. What you should do, rather than hand coding and entire coach in HTML, is create a Coach View for just your button and then have it fire a boundary event (like other buttons do) so that your process can function in the normal way.

If you compartmentalize properly you won't ever need to make that button again.

I WOULD NEVER RECOMMEND THAT ANYONE CREATE A "client-side human service with a coach created by pure Custom HTML" as it simply defeats the purpose of the product. Do not manually create form controls with HTML in BPM it's wrong.

Your front end guy focusing on HTML & CSS should learn how to create Coach Views for the individual parts if you want that much control over the UI.