locked
sdk samples integration approach? RRS feed

  • Question

  • Hello, I was curious about the approach you take to integrate SDK sample code.  For example, here's the code for SDK.SAMPLES.ExecuteWorkflowRequest() which is used to execute an on-demand w/f from js:

    https://www.dropbox.com/s/3r4repzp0ql9ca7/SDK.SAMPLES.ExecuteWorkflowRequest.txt

    However, in this sample, EntityId and WorkflowId are hard-coded. To use this in my application I would make this an ExecuteWorkflowRequest.js file to delegate and encapsulate the complexity. Then I would update the method signature to accept dynamic parameters for EntityId and WorkflowId so this function could be used by several different js functions to call several different workflows in the future.

    However, if I add the dynamic function parameters then the code is no longer copy/paste boilerplate SDK.SAMPLES code. Therefore, should the namespace in this example be renamed to reflect the namespace for the application like MyApp.Scripts?  I'm thinking that it should and a js comment should simply be added to the top of the script stating that everything but the parameters was copied from SDK.SAMPLES.ExecuteWorkflowRequest().

    Is the approach that you would take for this scenario or would you take a different approach?
    Thursday, April 3, 2014 5:23 PM