input
stringlengths
10
828
output
stringlengths
5
107
public process instance new process string process name return get definition process name create process instance
create a new process instance
public task instance get task long task instance id jbpm context context get context task instance instance context get task instance task instance id context close return instance
fetch the task instance
public void deploy string file name file input stream file null try file new file input stream file name catch exception e stand util print create process definition excepion file name stand util debug e process definition definition process definition parse xml input stream file jbpm context context get context context deploy process definition definition context close
upload the process definition
public object get bean string class name return factory get bean class name
fetch a bean instance
private boolean check content string type stand util print type for int i 0 i file type length i if type trim equals ignore case file type i return true set error err type return false
check type of the file
private void parse excel input stream stream hssfworkbook book null try book new hssfworkbook stream catch exception e stand util print file read exception return for int i 0 i book get number of sheets i hssfsheet sheet book get sheet at i this count sheet get last row num for int r 1 r sheet get last row num r save data sheet get row r dbfacade facade dbfacade jbpm factory get bean db facade facade import day report2 sheet
parse the excel file
private void save data hssfrow row if type null equals type return else if type equals report save bus tms dayreport row else if type equals mobile save filter new mobile row else if type equals test save bus tms callmobile row
save record to database
private void save file file item item long size item get size if size file size set error err size stand util print file size is too big return try item write new file path stand util file item get name catch exception e stand util print file writing exception
save the file to disk
public list list all final map map return list entry execute new hibernate callback public object do in hibernate session session criteria ctr session create criteria sys parameter class if stand util not empty map get para type ctr add expression eq para type map get para type if stand util not empty map get dscr ctr add expression eq dscr map get dscr if stand util not empty map get para cde ctr add expression like para cde map get para cde return ctr list
list all records
public list list all final map map return list entry execute new hibernate callback public object do in hibernate session session criteria ctr session create criteria sys parameter type class if stand util not empty map get para type ctr add expression eq para type map get para type if stand util not empty map get dscr ctr add expression eq dscr map get dscr return ctr list
list all records
public bus tms require get sheet by id string list id list list list from bus tms require s where s list id list id if list null list size 0 return bus tms require list get 0 else return null
fetch the sheet by list id
public bus tms require get sheet by proj code string project code list list list from bus tms require s where s project code project code if list null list size 0 return bus tms require list get 0 else return null
fetch the sheet by project code
public sys organization get organization by ouguid string ouguid string sql value from sys organization s where s ouguid ouguid if list sql value size 0 list sql value null return sys organization list sql value get 0 else return null
list sys organization id
public void save sms log sms endbox log sms endbox throws exception this save log sms endbox
log sms endbox
public long count by project final string project code object obj entry execute new hibernate callback public object do in hibernate session session string hql select count from filter result mobile as vo where vo project code project code return session create query hql unique result return stand util to long obj
count table by project code
public list list by package final string project code final int num package return list entry execute new hibernate callback public object do in hibernate session session criteria ctr session create criteria filter result mobile class ctr add expression eq project code project code ctr set max results num package return ctr list
list record by project code
public list list sheet int sheet type string sheet status list list null switch sheet type case jbpm constants tms sht require list list tms require sheet status break case jbpm constants tms sht cancel list list tms cancel sheet status break case jbpm constants tms sht quality list list quality form sheet status break case jbpm constants tms sht complain list list complain form sheet status break case jbpm constants tms sht balancee list list tms balance sheet status break return list
list sheet by type and status
public map handle flow map map string transition string task string map get task name string flag string map get flag if task equals jbpm constants complain down record transition complain confirm flag else if task equals jbpm constants complain confirm transition ressp confirm flag else if task equals jbpm constants complain check transition provinv check flag map pout new hash map pout put jbpm constants jbpm transition transition return pout
handle marmot rpc command
public string complain confirm string flag string transition if flag equals jbpm constants quality jbpm sendagain transition jbpm constants complain sendagain else if flag equals jbpm constants jbpm yes transition jbpm constants complain reasonable else transition jbpm constants complain unreasonable return transition
quality check complain confirm
public map handle flow map map string transition string task string map get task name string flag string map get flag if task equals jbpm constants quality check quality transition check records flag if task equals jbpm constants quality sp confirm transition spconfirm flag map pout new hash map pout put jbpm constants jbpm transition transition return pout
handle marmot rpc command
public void upload wrong process entry jbpm marmot factory get jbpm map pmap new hash map pmap put if upload wrong true jbpm new process quality check pmap
return the records if right
public void create excel list list output stream output hssfworkbook excel new hssfworkbook hssfsheet sheet excel create sheet hssfcell cell null hssfrow row null int i 0 row sheet create row 0 cell row create cell short 0 cell set cell value for object obj list i row sheet create row i cell row create cell short 0 cell set cell value string obj try excel write output catch exception e stand util print create excel file exception
creat download the quality mobile
public void quality mobile down string quality id output stream output ibus quality report dao ibus quality report get dao bus quality report list quality report vos dao get mobile by quality id quality id list mobile new array list int i 0 bus quality report vo null if quality report vos null quality report vos size 0 for i 0 i quality report vos size i vo bus quality report quality report vos get i mobile add vo get mobile create excel mobile output create txt mobile output
download the quality mobile
protected abstract dao get dao string bean name return jbpm factory get dao bean name
fetch a dao reference
public string get operate desc string table name string operate type string operate dscr if operate type equals operate dscr table name else if operate type equals operate dscr table name else if operate type equals operate dscr table name else operate dscr table name return operate dscr
fetch the operation describe
public string get operate remark string full name string oug name string operate dscr string ramark oug name n full name n operate dscr return ramark
fetch the operation remark
public object convert task object obj throws exception map map map obj long task id stand util to long map get task id string employee string map get employee entry to single task task id employee return null
convert a task to single
public object task command object obj throws exception map map map obj long task id stand util to long map get task id return jbpm facade get variables task id
fetch process map by task id
public void list all data set data throws exception int page size data get page size int page index data get page index map map map data get parameters map put all get user session string bean name string map get bean name list list jbpm factory get dao bean name list all map if list null list size 1 return int start page index 1 page size int end start page size if end list size end list size data set record count list size data add records list sub list start end
list all records marmot data provider
public object fetch token object obj throws exception map map map obj long jbpm id stand util to long map get jbpm id long token jbpm facade fetch token jbpm id map pout new hash map pout put token token return pout
put the process token into session
public void list sheet data set data throws exception map map map data get parameters int sheet type stand util to int map get sheet type string sheet status string map get sheet status flow monitor service serv new flow monitor service list list serv list sheet sheet type sheet status if list null data set record count list size data add records list
list all records marmot data provider
public object count call object obj throws exception map map map obj string list id string map get list id ibus tms callmobile dao ibus tms callmobile get dao bus tms callmobile long total dao count by list list id map pout new hash map pout put total total return pout
count call mobile by list id
public void execute string node name map pmap
handle the action
public object get dao string bean name return jbpm factory get dao bean name
fetch a dao reference
public void context destroyed servlet context event arg0 log info try scheduler scheduler scheduler utility get system scheduler if scheduler null scheduler shutdown log info quartz scheduler else log info scheduler null catch scheduler exception e e print stack trace log error web application quartz scheduler
web application scheduler
public object get service string bean name return jbpm factory get service bean name
fetch a bean instance
public object log command object obj throws exception new log service logging map obj return null
write operation log
public string get spouguid string list id ibus tms require dao ibus tms require get dao bus tms require bus tms require vo bus tms require dao get sheet by id list id return vo get final sp id
get sp ouguid by list id
public jbpm configuration get configuration return jbpm template get jbpm configuration
fetch the jbpm configuration
public void set spring spring factory spring this spring spring
inject the spring factory
public jbpm context get context return get configuration create jbpm context
fetch the jbpm context
public process definition get definition final string process name process definition pd process definition jbpm template execute new jbpm callback public object do in jbpm jbpm context context graph session session context get graph session process definition process definition session find latest process definition process name return process definition return pd
fetch the process definition
public map get process map final long task id return map jbpm template execute new jbpm callback public object do in jbpm jbpm context context return context get task instance task id get variables
fetch the task instance
public void new process final string process name final map pmap stand util print start a new process process name jbpm template execute new jbpm callback public object do in jbpm jbpm context context process definition pd context get graph session find latest process definition process name process instance proc pd create process instance context instance ci proc get context instance pmap put jbpm constants jbpm id proc get id pmap put jbpm constants jbpm name process name ci add variables pmap proc signal return null
create a new process instance
public void to single task final long task id final string actor stand util print convert a task to single actor jbpm template execute new jbpm callback public object do in jbpm jbpm context context task instance task context get task instance task id task set actor id actor context save task return null
convert a shared task to single
public void deploy string file name file input stream file null try file new file input stream file name catch exception e stand util print create process definition excepion file name process definition definition process definition parse xml input stream file jbpm context context get context context deploy process definition definition context close
deploy the process definition
public list list task final string actor id return list jbpm template execute new jbpm callback public object do in jbpm jbpm context context list list context get task list actor id list add all jbpm template find pooled task instances actor id return list
list all task by actor id
public void finish task final long task id final map pmap jbpm template execute new jbpm callback public object do in jbpm jbpm context context task instance task context get task instance task id task get context instance add variables pmap task end return null
end a task and transfer to next node
public void execute execution context context throws exception context instance instance context get context instance process instance pi instance get process instance string process name pi get process definition get name string node name context get node get name map pmap instance get variables jbpm factory get flow process name execute node name pmap
implements the method of action handler handle action event
public void list all data set data throws exception dorado context context dorado context get context string actor id string context get attribute dorado context session employee actor id 08041010033412500001 list list find all task actor id data set record count list size data add records list
list all records
public void second try log write uptime tick n log flush catch exception e error error exit uptime unexpected exception caught e
every second called by second timer
public void add change event listener change event listener change event listener if this listeners contains change event listener this listeners add element change event listener
add a listener to this set
public void remove change event listener change event listener change event listener if this listeners contains change event listener this listeners remove change event listener
remove a listener from this set
public void fire added distributed item di enumeration e this listeners elements while e has more elements change event listener cel change event listener e next element cel was added di
fires the event to all listeners
public void fire change distributed item di enumeration e this listeners elements while e has more elements change event listener cel change event listener e next element cel was changed di
fires the event to all listeners
public void fire removed distributed item di enumeration e this listeners elements while e has more elements change event listener cel change event listener e next element cel was removed di
fires the event to all listeners
public boolean get bool string key return boolean value of this get string key boolean value
gets a boolean for the given key from this resource bundle
public void second log tick false
every second called by second timer
public void log string msg boolean with time try string now if with time now calendar get instance get time to string log write uptime msg now n log flush catch exception e error error exit uptime unexpected exception caught e
write code msg code to system log
public int get int string key return integer parse int this get string key
gets a int for the given key from this resource bundle
public long get long string key return long parse long this get string key
gets a long for the given key from this resource bundle
public int free return capacity size 1
returns the number of empty positions in this queue
public void set object string key object value if props contains key key if is debug logger debug reset key from props get key to string to value to string props remove key props put key value if logger is info enabled logger info changed property logger info key value to string
adds or reset a property for the given code key code
public int size int i h last first maybe elements wrap around array end if last first i h capacity return i h
returns the number of elements in this queue
protected object handle get object string key if props contains key key return props get key else return null
gets an object for the given key from this resource bundle
protected void init if running logger debug init running true thread group tg new thread group second timer tg set daemon true waiter thread new waiter thread tg second timer clk this waiter thread start executor thread new executor thread tg second timer x this executor thread start else logger warn init called while running logger debug running running
initialize and start the timer
public boolean has next if i has next i l iterator return i has next
returns code true code if the iteration has more elements
public object next if i has next i l iterator if has next return i next else return null
returns the next element in this iteration
public void remove i remove
removes the current element from the underlying list
private void stp if running logger debug timer is stopping running false inform threads about stop this notify all additionally interrupt them waiter thread interrupt executor thread interrupt we will not use them anny more waiter thread null executor thread null else logger warn stp called while not running logger debug running running
stops this timer and its
public void test int number logger debug get settings for node number de sty janco properties p new de sty janco properties number logger debug using these properties java util array list list java util collections list p get keys java util collections sort list java util iterator i list iterator logger debug print all settings while i has next string key string i next logger debug key p get object key to string
tests the outer class
protected long get d return delay
getter method for the delay in milliseconds
protected void set d long millis if millis 0 delay millis
sets a new delay in milliseconds
public void sl long millis try sleeping true thread current thread sleep millis sleeping false catch interrupted exception ie logger warn interrupted exception while sleeping catch exception e logger error caught exception e
sleep for code millis code milli seconds
protected boolean is running return running
get the status of this timer
protected void finalize throws java lang throwable try super finalize running false this notify all if waiter thread is alive waiter thread interrupt if executor thread is alive executor thread interrupt catch exception e logger error caught exception e
stops the thread if running
public int get idle size return running size
get the number of idle threads
public int get running size return running size
get the number of running threads
public void run logger debug start running terminates if only this thread is running at last while running try synchronized sync sync wait delay check if we were notified by waiter thread if running new second sync fire timer event new second false else logger debug notified but no new second should i run running catch interrupted exception e logger debug got interrupted should i run running logger debug stop running
this method runs in an own thread
public void second ticks simulate different types of listeners switch sw case 0 a simple and fast listener logger debug got tick break case 1 a to slow listener logger debug use more than 1 second misc sleep 1100 logger debug finished with more than 1 second break case 2 for the long time test logger debug got tick break
every second called by second timer
public boolean is living return living
returns if the
public runnable get target return this target
get the current target
public boolean is living return this living
returns code true code if this thread is living
public void run loop 20 times and sleep in between this should take nearly 2 seconds to finish int i h 20 while i h 0 logger debug this name runs i h try synchronized this logger debug this name waits wait 100 catch interrupted exception ie maybe our thread got killed here i h 0 logger warn this name was interrupted catch exception e logger error this name caught an exception e logger debug this name finished
this method got called in an own thread
protected method resolve function function mapper functions throws elexception if the map is null then the function is invalid if functions null return null normalize function name string prefix null string local name null int index function name index of if index 1 prefix local name function name else prefix function name substring 0 index local name function name substring index 1 ensure that the function s name is mapped method target method functions resolve function prefix local name return target
returns the code method code which is mapped to the function
public object parse string str throws invalid number exception out of range exception if str null str trim equals throw new invalid number exception empty exception number num null try num a decimal format parse str catch parse exception e throw new invalid number exception not a number if num instanceof java math big decimal num instanceof java math big integer throw new out of range exception out of range exception return num
big decimal big integer
private void set port int my port m my port my port
creates new connection slave
public void uninstall m quiz controller stop game m desktop pane remove m main frame if m clone window null m clone window set visible false
uninstalls this subset from the system
public game state change enum get game state enum return m game state enum
get the current game state
public int get current level return m current level
get the current question number level
public string get level title return m level title
get the current title for this level
public string get player name return m player name
returns the name of the current player
public void set game state enum game state change enum type if m restricted throw new unsupported operation exception restricted mode m game state enum type
sets the current game state
public void game mode changed game mode change event evt game mode enum evt type evt get type m game mode evt type if evt type game mode enum standalone evt type game mode enum master reset to standalone master mode else if evt type game mode enum slave reset for slave mode else if evt type game mode enum reset stop game
changes the game mode
public void set current level int number if m restricted throw new unsupported operation exception restricted mode if number 0 number 0 m current level number return
set the current question level number
public void action performed action event evt if evt get source m timer m elapsed time m alpha m alpha delta if m elapsed time m fade duration m alpha 1 0f time elapsed or full opaque stop timer m timer stop m alpha 1 0f set to full opaque repaint
listener callback for timer events
public void set level title string title if m restricted throw new unsupported operation exception restricted mode m level title title return
sets the current level title
public int increment current level int increment if m restricted throw new unsupported operation exception restricted mode int number m current level increment set current level number return number
increments the current question level number by the given increment
public void set player name string name if m restricted throw new unsupported operation exception restricted mode m player name new string name return
sets the name of the current player
public int get time if m countdown return m time limit m elapsed time else return m elapsed time
gets the current time