Skip to content

Instantly share code, notes, and snippets.

@garyjoy
garyjoy / 01
Created July 7, 2014 06:25
Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5)
/* This is a synchronous version of "callService()" that we can use in our Lazy-Loading Data Grids. */
tw.coach.callSynchronousService = function (service, params, snapshot) {
if (snapshot == "" || snapshot == null) {
snapshot = coachSnapshotContext;
}
var url = "/portal/jsp/callService.do?serviceName=" + service + "&snapshotId=" + snapshot;
return callSynchronousServiceImpl(url, params);
};
/* This is a synchronous version of "callServiceImpl()" that we can use in our Lazy-Loading Data Grids.
@garyjoy
garyjoy / 02
Created July 7, 2014 06:26
Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5)
dojo.require("dojox.data.QueryReadStore");
dojo.provide("bt.LazyLoadStore");
dojo.declare("bt.LazyLoadStore", dojox.data.QueryReadStore, {
lazyLoadFunction: null,
constructor: function(args) {
dojo.safeMixin(this,args);
},
@garyjoy
garyjoy / 03
Created July 7, 2014 06:26
Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5)
function lazyLoadMyData(request) {
console.log("lazyLoadMyData(): " + JSON.stringify(request.query));
var inputs;
inputs = "<inputs>"
+ "<variable name ='filter'>" + request.query.myFilter + "</variable>"
+ "<variable name ='start'>" + request.start + "</variable>"
+ "<variable name ='count'>" + request.count + "</variable>"
@garyjoy
garyjoy / 04
Created July 7, 2014 06:26
Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5)
var snapShotId = '<#= tw.system.model.processAppSnapshot.id #>';
@garyjoy
garyjoy / 05
Created July 7, 2014 06:32
Implement a Lazy-Loading Table in a Report (on IBM BPM v7.5)
function createLazyGrid(containerId, tableStructure, dojoDataStore, queryFilter) {
var gridParameters = {
structure: tableStructure,
selectable: true,
store: dojoDataStore,
escapeHTMLInData: false,
autoRender: true,
autoWidth: true,
autoHeight: true,
-- select Process Application...
select PROJECT_ID, NAME from LSW_PROJECT where IS_TOOLKIT = 'F' and IS_ARCHIVED = 'F' and IS_HIDDEN = 'F' order by name;
-- 00bffc67-8997-4042-bd49-3150bc7b7d72 (Project ID)
-- select Snapshot and Branch...
select * from LSW_SNAPSHOT where PROJECT_ID = '00bffc67-8997-4042-bd49-3150bc7b7d72' and name is not null ORDER BY CREATED_ON DESC;
-- 4ea36473-5a07-44d1-a331-f1cc2ffa19ab -> 293648c3-b432-4178-8e29-d068d44daa58 (Snapshot IDs)
-- 55fbf4a8-1847-427e-9fdb-efda57d9533c (Branch ID)
function logError(component, error, context) {
var processId = "";
var taskId = "";
if (tw.system.currentProcessInstanceID != null) {
processId = tw.system.currentProcessInstanceID;
}
if (tw.system.currentTask != null) {
taskId = tw.system.currentTask.id;
}
callService = function(service, params, logDetail, snapshot) {
var url = "/portal/jsp/callService.do?serviceName=" + service + "&snapshotId=" + snapshot;
callServiceImpl(url, params, logDetail);
};
function callServiceImpl(url, params, logDetail) {
var parameters = "input=" + encodeURIComponent(params);
var http_request = null;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
@garyjoy
garyjoy / gist:94f4467b34268b9fe15a
Created February 1, 2015 12:55
Elevator Game (01/01/2015)
{
init: function(elevators, floors) {
// Extend the Elevators with Names and Ranges...
for (var i = 0; i < elevators.length; ++i) {
elevators[i].name = i;
elevators[i].bottomFloor = 0;
elevators[i].topFloor = 8;
}
import argparse
import pypyodbc
import sys
from SomeClass import retrieveCredentials, resultsToXml, appendToFile
def executeScript(database, script, outputFilePath):
"""
Execute the specified (SQL) --script against the specified --database and save the results (as XML) using the specified --outputFilePath