Topic
  • 11 replies
  • Latest Post - ‏2013-04-25T14:31:11Z by Raj4All
Raj4All
Raj4All
84 Posts

Pinned topic How to bind / use Process Variables in Custom HTML Blocks present in Coaches / Coach Views in IBM BPM 8.0.1

‏2013-04-24T11:45:05Z |

Hi Kolban / Makvell,

The below is the requirement i have

1) Is accessing content / data of the Textbox is possible using dojo.byId and document.getElementById .When i use same in Heritage Coach i am able to access the Fields data.Do i have to add anything to Import DOJO to work in Coach Views.The requirement is to get this work in Coach  View.

2) we are trying to access the process variable in a Custom HTML Script using eg:<#= tw.local.rate #> and also using "tw#local#rate".The above snippets work after binding the data to the variable when we use Heritage Coaches , but the same is not working whe we try to use this in a coach view.

and "Kolban" Replied saying,

In BPM v8 the whole coach framework was reworked/replaced.  The pre-v8 Coach technology is still present and is now called "heritage coaches".  If you use those. I believe you will have all the functions you used to have.  However, the new v8 Coaches are (opinion) vastly superior but require you to learn the new concepts of Coach Views.  These are the encapsulations for logic and other functions.  It is no longer meaningful to try and access the "HTML" of a Coach in Custom HTML.  Instead, you would want to write new Coach Views which have the desired function.

For example, the new V8 Coach View called "Text Input" is bound to a variable.  When the user changes the text in the screen, the corresponding variable is immediately updated.  This can then be used to immediately trigger another Coach View that is watching to see any changes and it can perform arbitrary logic based on the variable change.

Kolban / Makvell,

Can you Please share a small working example for the scenario marked in red in the above and please provide me some valuable links,tutorials to get a better understanding on the COACH VIEW Event Handling technique and the CONTEXT object in COACH VIEW.

Thanks.

 

 

Updated on 2013-04-25T14:29:13Z at 2013-04-25T14:29:13Z by Raj4All
  • makvell
    makvell
    269 Posts
    ACCEPTED ANSWER

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T07:15:50Z  
    This reply was deleted by Raj4All 2013-04-25T07:25:19Z.

    This is the last time I give a ready-made solution. In my message explained everything step by step. Read carefully please.

     

    upd1: cannot attache file, maybe later :(

    upd2: yeap, attached :)

    Attachments

    Updated on 2013-04-25T08:00:27Z at 2013-04-25T08:00:27Z by makvell
  • makvell
    makvell
    269 Posts
    ACCEPTED ANSWER

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T10:27:36Z  
    • Raj4All
    • ‏2013-04-25T09:55:49Z

    Hi Makvell,

    This is working as expected.Thank you so much.if you dont mind may i know your work experience on IBM BPM.

    Please guide me with the tutorials and Links which helps me to enrich my Skills on DOJO and BPM.

    Thanks.

    No problems :)

    Lombardi Teamworks from 2010 year, IBM BPM Advanced 7.5 from 2012 year and IBM BPM Advanced 8 from... 2 months :)

    Useful resources:

    http://livedocs.dojotoolkit.org/

    http://dojotoolkit.org/reference-guide/1.7/ (reference)

    http://dojotoolkit.org/documentation/ (tutorials)

    http://bpmwiki.blueworkslive.com/display/samples/Working+with+Coach+Views

    http://www.neilkolban.com/IBM/

    https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000002382 :)

  • makvell
    makvell
    269 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-24T12:32:55Z  

    So what's the problem?
    Make a copy of the textbox control and add the event publishing functionality on value changes. And in another coach view add code to subscribe to this event and program logic as you need.

    Start here: http://dojotoolkit.org/reference-guide/1.7/dojo/publish.html

  • Raj4All
    Raj4All
    84 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-24T14:12:00Z  
    • makvell
    • ‏2013-04-24T12:32:55Z

    So what's the problem?
    Make a copy of the textbox control and add the event publishing functionality on value changes. And in another coach view add code to subscribe to this event and program logic as you need.

    Start here: http://dojotoolkit.org/reference-guide/1.7/dojo/publish.html

    Hi Makvell,

    I am new to DOJO and started looking in to it from few days.If you can explain in much more clean way then it will help me or a small working example with a a Textbox will surely satisfy my need.

    In the mean time i will go through the link shared.

    Thanks.

  • kolban
    kolban
    3322 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-24T19:56:38Z  
    • makvell
    • ‏2013-04-24T12:32:55Z

    So what's the problem?
    Make a copy of the textbox control and add the event publishing functionality on value changes. And in another coach view add code to subscribe to this event and program logic as you need.

    Start here: http://dojotoolkit.org/reference-guide/1.7/dojo/publish.html

     

    LOL on your chosen image for the forums.  Ive never seen anyone do that before but now you have, it seems obvious.  Made my day to see that.

     

    Neil

  • makvell
    makvell
    269 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T05:53:15Z  
    • Raj4All
    • ‏2013-04-24T14:12:00Z

    Hi Makvell,

    I am new to DOJO and started looking in to it from few days.If you can explain in much more clean way then it will help me or a small working example with a a Textbox will surely satisfy my need.

    In the mean time i will go through the link shared.

    Thanks.

    Copy text CV to your processapp/toolkit and do some modification.

    In "load" event handler, replace function:

    onChangeHandle = connect.connect(comboBox, "onChange", this, function() {
        if (this.context.binding && comboBox.isValid()) {
            this.context.binding.set("value", comboBox.get('value'));
        }
    });

    with:

    onChangeHandle = connect.connect(comboBox, "onChange", this, function() {
        var ctx = this.context;
        if (ctx.binding && comboBox.isValid()) {
            ctx.binding.set("value", comboBox.get('value'));
            //publish event with CV id and new value
            connect.publish("textboxupdate", {
                viewid: ctx.viewid,
                value: comboBox.get('value')
            });
        }
    });

    And where you need react on this change, add function:

    require(["dojo/_base/connect"], function(connect){
        connect.subscribe("textboxupdate", function(mess){
            //replace this line with your logic
            alert("Changed textbox with id: " + mess.viewid + ", new value is: " + mess.value);
        });
    });

    Updated on 2013-04-25T07:16:26Z at 2013-04-25T07:16:26Z by makvell
  • makvell
    makvell
    269 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T05:56:19Z  
    • kolban
    • ‏2013-04-24T19:56:38Z

     

    LOL on your chosen image for the forums.  Ive never seen anyone do that before but now you have, it seems obvious.  Made my day to see that.

     

    Neil

    Good humor helps productive work ;)

  • makvell
    makvell
    269 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T07:15:50Z  
    This reply was deleted by Raj4All 2013-04-25T07:25:19Z.

    This is the last time I give a ready-made solution. In my message explained everything step by step. Read carefully please.

     

    upd1: cannot attache file, maybe later :(

    upd2: yeap, attached :)

    Attachments

    Updated on 2013-04-25T08:00:27Z at 2013-04-25T08:00:27Z by makvell
  • Raj4All
    Raj4All
    84 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T09:55:49Z  
    • makvell
    • ‏2013-04-25T07:15:50Z

    This is the last time I give a ready-made solution. In my message explained everything step by step. Read carefully please.

     

    upd1: cannot attache file, maybe later :(

    upd2: yeap, attached :)

    Hi Makvell,

    This is working as expected.Thank you so much.if you dont mind may i know your work experience on IBM BPM.

    Please guide me with the tutorials and Links which helps me to enrich my Skills on DOJO and BPM.

    Thanks.

  • makvell
    makvell
    269 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T10:27:36Z  
    • Raj4All
    • ‏2013-04-25T09:55:49Z

    Hi Makvell,

    This is working as expected.Thank you so much.if you dont mind may i know your work experience on IBM BPM.

    Please guide me with the tutorials and Links which helps me to enrich my Skills on DOJO and BPM.

    Thanks.

    No problems :)

    Lombardi Teamworks from 2010 year, IBM BPM Advanced 7.5 from 2012 year and IBM BPM Advanced 8 from... 2 months :)

    Useful resources:

    http://livedocs.dojotoolkit.org/

    http://dojotoolkit.org/reference-guide/1.7/ (reference)

    http://dojotoolkit.org/documentation/ (tutorials)

    http://bpmwiki.blueworkslive.com/display/samples/Working+with+Coach+Views

    http://www.neilkolban.com/IBM/

    https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000002382 :)

  • Raj4All
    Raj4All
    84 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T12:17:21Z  
    • makvell
    • ‏2013-04-25T10:27:36Z

    Hi,

    What is the significance of AMD dependencies in the behavior section of a Coach View.Is it mandatory to add all the DOJo ModuleID while designing a Coach View.

    Please give a short Description on this and share some links on this.

    Thanks.

  • makvell
    makvell
    269 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T12:48:40Z  
    • Raj4All
    • ‏2013-04-25T12:17:21Z

    Hi,

    What is the significance of AMD dependencies in the behavior section of a Coach View.Is it mandatory to add all the DOJo ModuleID while designing a Coach View.

    Please give a short Description on this and share some links on this.

    Thanks.

    http://bpmwiki.blueworkslive.com/display/commwiki/Coach+Views+-+Some+Helpful+Dojo+Links+and+Notes

  • Raj4All
    Raj4All
    84 Posts

    Re: How to bind / use Process Variables in Coaches / Coach Views in the Custom HTML Blocks in IBM BPM 8.0.1

    ‏2013-04-25T14:31:11Z  
    • makvell
    • ‏2013-04-25T12:48:40Z

    Hi Makvell,

    Thanks, for the support ,sharing your ideas and time.