idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
13,800
public List < TaskAction > filterStandardActions ( List < TaskAction > standardTaskActions ) throws ServiceException , DataAccessException { CodeTimer timer = new CodeTimer ( "TaskManager.filterStandardTaskActions()" , true ) ; List < TaskAction > filteredTaskActions = standardTaskActions ; try { ActivityInstance activ...
Filters according to what s applicable depending on the context of the task activity instance .
13,801
public List < TaskAction > getCustomActions ( ) throws ServiceException , DataAccessException { CodeTimer timer = new CodeTimer ( "getCustomActions()" , true ) ; List < TaskAction > dynamicTaskActions = new ArrayList < TaskAction > ( ) ; try { ActivityInstance activityInstance = getActivityInstance ( true ) ; if ( acti...
Gets the custom task actions associated with a task instance as determined by the result codes for the possible outgoing work transitions from the associated activity .
13,802
protected URL getRoutingStrategyDestination ( Object request , Map < String , String > headers ) { for ( RequestRoutingStrategy routingStrategy : MdwServiceRegistry . getInstance ( ) . getRequestRoutingStrategies ( ) ) { URL destination = routingStrategy . getDestination ( request , headers ) ; if ( destination != null...
Returns an instance of the first applicable routing strategy found based on priority of each strategy or null if none return a URL .
13,803
public User getUser ( String cuid ) { User user = UserGroupCache . getUser ( cuid ) ; if ( user == null ) return null ; if ( user . getAttributes ( ) == null ) user . setAttributes ( new HashMap < String , String > ( ) ) ; for ( String name : UserGroupCache . getUserAttributeNames ( ) ) { if ( ! user . getAttributes ( ...
Does not include non - public attributes . Includes empty values for all public attributes .
13,804
public boolean validate ( ) { _validationError = null ; List < XmlError > errors = new ArrayList < XmlError > ( ) ; boolean valid = _xmlBean . validate ( new XmlOptions ( ) . setErrorListener ( errors ) ) ; if ( ! valid ) { _validationError = "" ; for ( int i = 0 ; i < errors . size ( ) ; i ++ ) { _validationError += e...
Performs validation on the XmlBean populating the error message if failed .
13,805
static ProgressMonitor getMonitor ( ) { return new ProgressMonitor ( ) { public void message ( String msg ) { System . out . println ( msg + "..." ) ; } public void progress ( int prog ) { if ( "\\" . equals ( System . getProperty ( "file.separator" ) ) ) { System . out . print ( "\b\b\b\b\b\b\b\b\b" ) ; } else { Syste...
Every call with > = 100% progress will print a new line .
13,806
public List < String > getExcludedTables ( ) { List < String > dbTables = project . readDataList ( "data.excluded.tables" ) ; if ( dbTables == null ) dbTables = DEFAULT_EXCLUDED_TABLES ; return dbTables ; }
Tables excluded from export which need to be purged on import .
13,807
@ Path ( "/{roleName}" ) @ ApiOperation ( value = "Retrieve a role or all roles" , notes = "If roleName is not present, returns all roles." , response = Role . class , responseContainer = "List" ) public JSONObject get ( String path , Map < String , String > headers ) throws ServiceException , JSONException { UserServi...
Retrieve a user role or the list of all roles .
13,808
public static Package getProcessPackage ( Long processId ) { try { if ( processId != null ) { for ( Package pkg : getPackageList ( ) ) { if ( pkg . containsProcess ( processId ) ) return pkg ; } } return Package . getDefaultPackage ( ) ; } catch ( CachingException ex ) { logger . severeException ( ex . getMessage ( ) ,...
Returns the design - time package for a specified process ID . Returns the first match so does not support the same process in multiple packages . Also assumes the processId is not for an embedded subprocess .
13,809
public static Package getTaskTemplatePackage ( Long taskId ) { try { for ( Package pkg : getPackageList ( ) ) { if ( pkg . containsTaskTemplate ( taskId ) ) return pkg ; } return Package . getDefaultPackage ( ) ; } catch ( CachingException ex ) { logger . severeException ( ex . getMessage ( ) , ex ) ; return null ; } }
Returns the design - time package for a specified task ID . Returns the first match so does not support the same template in multiple packages .
13,810
public String getPath ( ) { Matcher matcher = pathPattern . matcher ( name ) ; if ( matcher . find ( ) ) { String match = matcher . group ( 1 ) ; int lastDot = match . lastIndexOf ( '.' ) ; if ( lastDot == - 1 ) throw new IllegalStateException ( "Bad asset path: " + match ) ; return match . substring ( 0 , lastDot ) . ...
File path corresponding to name .
13,811
public Object onRequest ( Object request , Map < String , String > headers ) { if ( headers . containsKey ( Listener . METAINFO_HTTP_METHOD ) ) { Tracing tracing = TraceHelper . getTracing ( "mdw-service" ) ; HttpTracing httpTracing = HttpTracing . create ( tracing ) ; handler = HttpServerHandler . create ( httpTracing...
Only for HTTP services .
13,812
public static List < Process > getProcessesSmart ( AssetVersionSpec spec ) throws DataAccessException { if ( spec . getPackageName ( ) == null ) throw new DataAccessException ( "Spec must be package-qualified: " + spec ) ; List < Process > matches = new ArrayList < > ( ) ; for ( Process process : getAllProcesses ( ) ) ...
Find all definitions matching the specified version spec . Returns shallow processes .
13,813
protected ConnectionFactory retrieveConnectionFactory ( String name ) throws JMSException { if ( name == null && defaultConnectionFactory != null ) { return defaultConnectionFactory ; } else { try { return ( ConnectionFactory ) SpringAppContext . getInstance ( ) . getBean ( name ) ; } catch ( Exception ex ) { logger . ...
Pooling and remote queues are configured via Spring in broker config XML .
13,814
private Process getPackageHandler ( ProcessInstance masterInstance , Integer eventType ) { Process process = getProcessDefinition ( masterInstance ) ; Process handler = getPackageHandler ( process . getPackageName ( ) , eventType ) ; if ( handler != null && handler . getName ( ) . equals ( process . getName ( ) ) ) { l...
Finds the relevant package handler for a master process instance .
13,815
public String invokeService ( Long processId , String ownerType , Long ownerId , String masterRequestId , String masterRequest , Map < String , String > parameters , String responseVarName , Map < String , String > headers ) throws Exception { return invokeService ( processId , ownerType , ownerId , masterRequestId , m...
Invoke a real - time service process .
13,816
public Map < String , String > invokeServiceAsSubprocess ( Long processId , Long parentProcInstId , String masterRequestId , Map < String , String > parameters , int performance_level ) throws Exception { long startMilli = System . currentTimeMillis ( ) ; if ( performance_level <= 0 ) performance_level = getProcessDefi...
Called internally by invoke subprocess activities to call service processes as subprocesses of regular processes .
13,817
private ProcessInstance executeServiceProcess ( ProcessExecutor engine , Long processId , String ownerType , Long ownerId , String masterRequestId , Map < String , String > parameters , String secondaryOwnerType , Long secondaryOwnerId , Map < String , String > headers ) throws Exception { Process procdef = getProcessD...
execute service process using asynch engine
13,818
public Long startProcess ( Long processId , String masterRequestId , String ownerType , Long ownerId , Map < String , String > vars , Map < String , String > headers ) throws Exception { return startProcess ( processId , masterRequestId , ownerType , ownerId , vars , null , null , headers ) ; }
Start a process .
13,819
public Long startProcess ( Long processId , String masterRequestId , String ownerType , Long ownerId , Map < String , String > vars , String secondaryOwnerType , Long secondaryOwnerId , Map < String , String > headers ) throws Exception { Process procdef = getProcessDefinition ( processId ) ; int performance_level = pr...
Starting a regular process .
13,820
public static Asset getAsset ( AssetVersionSpec spec , Map < String , String > attributeValues ) { Asset match = null ; try { for ( Asset asset : getAllAssets ( ) ) { if ( spec . getName ( ) . equals ( asset . getName ( ) ) ) { if ( asset . meetsVersionSpec ( spec . getVersion ( ) ) && ( match == null || asset . getVer...
Get the asset based on version spec whose name and custom attributes match the parameters .
13,821
public static synchronized List < Asset > getJarAssets ( ) { if ( jarAssets == null ) { jarAssets = getAssets ( Asset . JAR ) ; } return jarAssets ; }
This is used by CloudClassLoader to search all JAR file assets
13,822
public List < String > getNotifierSpecs ( Long taskId , String outcome ) throws ObserverException { TaskTemplate taskVO = TaskTemplateCache . getTaskTemplate ( taskId ) ; if ( taskVO != null ) { String noticesAttr = taskVO . getAttribute ( TaskAttributeConstant . NOTICES ) ; if ( ! StringHelper . isEmpty ( noticesAttr ...
Returns a list of notifier class name and template name pairs delimited by colon
13,823
public List < String > getNotifierSpecs ( Long taskId , Long processInstanceId , String outcome ) throws ObserverException { String noticesAttr = null ; EventServices eventManager = ServiceLocator . getEventServices ( ) ; try { if ( processInstanceId != null ) { Process process = eventManager . findProcessByProcessInst...
Return a list of notifier class name and template name and version pairs Get the template name and notifier class names based on the process activity attributes to get the relevant values for in flight and new processes
13,824
private List < String > parseNoticiesAttr ( String noticesAttr , String outcome ) { List < String > notifiers = new ArrayList < String > ( ) ; int columnCount = 4 ; int colon = noticesAttr . indexOf ( ";" ) ; if ( colon != - 1 ) { columnCount = StringHelper . delimiterColumnCount ( noticesAttr . substring ( 0 , colon )...
To parse notices attribute
13,825
public static void assertEquals ( String message , XmlCursor expected , XmlCursor actual ) { for ( int child = 0 ; true ; child ++ ) { boolean child1 = expected . toChild ( child ) ; boolean child2 = actual . toChild ( child ) ; if ( child1 != child2 ) { fail ( message , "Different XML structure near " + QNameHelper . ...
Uses cursors to compare two XML documents ignoring whitespace and ordering of attributes . Fails the JUnit test if they re different .
13,826
private static void assertAttributesEqual ( String message , XmlCursor expected , XmlCursor actual ) { Map < QName , String > map1 = new HashMap < QName , String > ( ) ; Map < QName , String > map2 = new HashMap < QName , String > ( ) ; boolean attr1 = expected . toFirstAttribute ( ) ; boolean attr2 = actual . toFirstA...
Compares the attributes of the elements at the current position of two XmlCursors . The ordering of the attributes is ignored in the comparison . Fails the JUnit test case if the attributes or their values are different .
13,827
private String getMainPropertyFileName ( ) throws StartupException { String configLoc = getConfigLocation ( ) ; File file = new File ( configLoc == null ? MDW_PROPERTIES_FILE_NAME : ( configLoc + MDW_PROPERTIES_FILE_NAME ) ) ; if ( file . exists ( ) ) return MDW_PROPERTIES_FILE_NAME ; URL url = this . getClass ( ) . ge...
Null means not found .
13,828
public File getCompiled ( AssetInfo asset , File starter ) throws IOException , ServiceException { File file ; synchronized ( WebpackCache . class ) { file = webpackAssets . get ( asset ) ; if ( file == null || ! file . exists ( ) || file . lastModified ( ) < asset . getFile ( ) . lastModified ( ) || ( starter != null ...
Starter file will be compiled but asset used to compute output path .
13,829
private void compile ( AssetInfo asset , File source , File target ) throws ServiceException { File watched = watchedAssets . get ( asset ) ; if ( watched == null ) { if ( isDevMode ( ) ) { new Thread ( ( ) -> { try { if ( isDevMode ( ) ) watchedAssets . put ( asset , target ) ; doCompile ( asset , source , target ) ; ...
Returns null except in dev mode .
13,830
public List < ServiceMonitor > getServiceMonitors ( ) { List < ServiceMonitor > serviceMonitors = new ArrayList < > ( ) ; serviceMonitors . addAll ( getDynamicServices ( ServiceMonitor . class ) ) ; return serviceMonitors ; }
Returns all service monitors .
13,831
protected TaskInstance createTaskInstance ( ) throws ActivityException { try { String taskTemplate = getAttributeValue ( ATTRIBUTE_TASK_TEMPLATE ) ; if ( taskTemplate == null ) throw new ActivityException ( "Missing attribute: " + ATTRIBUTE_TASK_TEMPLATE ) ; String templateVersion = getAttributeValue ( ATTRIBUTE_TASK_T...
Creates a new task instance based on the configured template for this activity .
13,832
public Map < String , String > getRequestHeaders ( ) { Map < String , String > requestHeaders = super . getRequestHeaders ( ) ; if ( requestHeaders == null ) requestHeaders = new HashMap < > ( ) ; try { requestHeaders . put ( Request . REQUEST_ID , getMasterRequestId ( ) ) ; String httpMethod = getHttpMethod ( ) ; if (...
Overridden to append JSON headers .
13,833
public Long getRequestId ( ) throws ActivityException { if ( requestId != null ) return requestId ; String requestIdVarName = getAttribute ( "requestIdVariable" , "requestId" ) ; Variable requestIdVar = getProcessDefinition ( ) . getVariable ( requestIdVarName ) ; if ( requestIdVar == null && ! "GET" . equals ( getHttp...
Returns the requestId that we will use to populate the serviceSummary
13,834
public JSONObject handleEvent ( SlackEvent event ) throws ServiceException { if ( event . getCallbackId ( ) != null && event . getCallbackId ( ) . indexOf ( '_' ) > 0 && event . getCallbackId ( ) . indexOf ( '/' ) > 0 && event . getTs ( ) != null ) { Long instanceId = Long . parseLong ( event . getCallbackId ( ) . subs...
Messages posted on the tasks channel .
13,835
public static void writeToFile ( String pFileName , String pContents , boolean pAppend ) throws IOException { FileWriter writer = null ; writer = new FileWriter ( pFileName , pAppend ) ; writer . write ( pContents ) ; writer . flush ( ) ; writer . close ( ) ; }
Method that writes the file contents
13,836
public static InputStream openConfigurationFile ( String filepath , ClassLoader classLoader ) throws FileNotFoundException { File file = getConfigurationFile ( filepath ) ; if ( file . exists ( ) ) { logger . info ( "Located configuration file: " + file . getAbsolutePath ( ) ) ; return new FileInputStream ( file ) ; } ...
Open configuration file . If Java system property mdw . config . location is defined and the file exists in that directory it will load the file . Otherwise it loads through the class path .
13,837
protected KieBase getKnowledgeBase ( String name , String modifier ) throws StrategyException { KnowledgeBaseAsset kbrs = DroolsKnowledgeBaseCache . getKnowledgeBaseAsset ( name , modifier , null , getClassLoader ( ) ) ; if ( kbrs == null ) { return null ; } else { return kbrs . getKnowledgeBase ( ) ; } }
Returns the latest version .
13,838
protected List < Attribute > getAttributes1 ( String ownerType , Long ownerId ) throws SQLException { List < Attribute > attrs = getAttributes0 ( ownerType , ownerId ) ; if ( attrs == null ) return null ; ResultSet rs ; String query = "select RULE_SET_DETAILS from RULE_SET where RULE_SET_ID=?" ; for ( Attribute attr : ...
Same as getAttribute1 but handles overflow values
13,839
public Document getDocument ( Long documentId ) throws DataAccessException { try { db . openConnection ( ) ; return this . getDocument ( documentId , false ) ; } catch ( SQLException ex ) { throw new DataAccessException ( "Failed to load document: " + documentId , ex ) ; } finally { db . closeConnection ( ) ; } }
Not for update . Opens a new connection .
13,840
@ SuppressWarnings ( "unchecked" ) public boolean evaluate ( List < String > completedActivities , List < VariableInstance > variableInstances ) throws SynchronizationException { if ( syncedActivityIds == null || syncedActivityIds . length == 0 ) return true ; try { Expression e = ExpressionFactory . createExpression (...
Checks whether the synchronization criteria can be considered to be met by evaluating the expression versus the list of completed activities .
13,841
public String getDefaultSyncExpression ( ) { String syncExpression = "" ; for ( int i = 0 ; i < syncedActivityIds . length ; i ++ ) { if ( i > 0 ) syncExpression += " && " ; syncExpression += syncedActivityIds [ i ] ; } return syncExpression ; }
Create the default sync expression based on the synced activity logical IDs .
13,842
public static RoutingStrategy getRoutingStrategy ( String attributeValue ) throws StrategyException { TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getStrategyClassName ( attributeValue , StrategyType . RoutingStrategy ) ; RoutingStrategy strategy = ( RoutingStrategy ) factory . g...
Returns a workgroup routing strategy instance based on an attribute value which can consist of either the routing strategy logical name or an xml document .
13,843
public static RoutingStrategy getRoutingStrategy ( String attributeValue , Long processInstanceId ) throws StrategyException { Package packageVO = processInstanceId == null ? null : getPackage ( processInstanceId ) ; TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getStrategyClassNa...
Returns a workgroup routing strategy instance based on an attribute value and bundle spec which can consist of either the routing strategy logical name or an xml document .
13,844
public static SubTaskStrategy getSubTaskStrategy ( String attributeValue ) throws StrategyException { TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getStrategyClassName ( attributeValue , StrategyType . SubTaskStrategy ) ; SubTaskStrategy strategy = ( SubTaskStrategy ) factory . g...
Returns a subtask strategy instance based on an attribute value which can consist of either the subtask strategy logical name or an xml document .
13,845
public static SubTaskStrategy getSubTaskStrategy ( String attributeValue , Long processInstanceId ) throws StrategyException { Package packageVO = processInstanceId == null ? null : getPackage ( processInstanceId ) ; TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getStrategyClassNa...
Returns a subtask strategy instance based on an attribute value and bundle spec which can consist of either the subtask strategy logical name or an xml document .
13,846
public static PrioritizationStrategy getPrioritizationStrategy ( String attributeValue ) throws StrategyException { TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getStrategyClassName ( attributeValue , StrategyType . PrioritizationStrategy ) ; PrioritizationStrategy strategy = ( P...
Returns a Prioritization routing strategy instance based on an attribute value which can consist of either the routing strategy logical name or an xml document .
13,847
public static PrioritizationStrategy getPrioritizationStrategy ( String attributeValue , Long processInstanceId ) throws StrategyException { Package packageVO = processInstanceId == null ? null : getPackage ( processInstanceId ) ; TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getS...
Returns a Prioritization routing strategy instance based on an attribute value and bundle spec which can consist of either the routing strategy logical name or an xml document .
13,848
public static AutoAssignStrategy getAutoAssignStrategy ( String logicalName ) throws StrategyException { TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getStrategyClassName ( logicalName , StrategyType . AutoAssignStrategy ) ; return ( AutoAssignStrategy ) factory . getStrategyInst...
Returns an auto - assign strategy instance based on the logical name .
13,849
public static AutoAssignStrategy getAutoAssignStrategy ( String logicalName , Long processInstanceId ) throws StrategyException { Package packageVO = processInstanceId == null ? null : getPackage ( processInstanceId ) ; TaskInstanceStrategyFactory factory = getInstance ( ) ; String className = factory . getStrategyClas...
Returns an auto - assign strategy instance based on the logical name and bundle spec .
13,850
public JavaFileObject getJavaFileForOutput ( Location location , String className , Kind kind , FileObject sibling ) throws IOException { if ( logger . isMdwDebugEnabled ( ) ) logger . mdwDebug ( "Loading Dynamic Java byte code from: " + ( sibling == null ? null : sibling . toUri ( ) ) ) ; try { JavaFileObject jfo = ne...
Create a new Java file object which will be used by the compiler to store the generated byte code . Also add a reference to the object to the cache so it can be accessed by other parts of the application .
13,851
protected ServiceSummary getServiceSummary ( ) throws ActivityException { ServiceSummary serviceSummary = ( ServiceSummary ) getVariableValue ( "serviceSummary" ) ; if ( serviceSummary == null ) throw new ActivityException ( "Missing variable: serviceSummary" ) ; return serviceSummary ; }
If you really must name the variable something other than serviceSummary you can override this method to retrieve its value .
13,852
protected Object openConnection ( ) throws ConnectionException { try { String dataSource = getDataSource ( ) ; if ( dataSource == null ) throw new ConnectionException ( "Missing attribute: " + JDBC_DATASOURCE ) ; DatabaseAccess dbAccess = new DatabaseAccess ( dataSource ) ; dbAccess . openConnection ( ) ; return dbAcce...
Returns a db connection based on the configured jdbc url or datasource which includes the resource path . Override for HTTPS or other connection type .
13,853
public Object invoke ( Object conn , Object requestData ) throws AdapterException { try { DatabaseAccess dbAccess = ( DatabaseAccess ) conn ; if ( requestData == null ) throw new AdapterException ( "Missing SQL Query" ) ; String query = ( String ) requestData ; QueryType queryType = getQueryType ( ) ; Object queryParam...
Invokes the JDBC Query . If QueryType is Select returns a java . sql . ResultSet . If QueryType is Update returns an Integer with the number of rows updated .
13,854
protected Object getRequestData ( ) throws ActivityException { try { return executePreScript ( getSqlQuery ( ) ) ; } catch ( Exception ex ) { throw new ActivityException ( ex . getMessage ( ) , ex ) ; } }
Returns the parameterized SQL query to execute .
13,855
@ SuppressWarnings ( "unchecked" ) public String getMasterRequestId ( Message request ) { List < SoapHeader > headers = ( List < SoapHeader > ) ( ( CxfPayload < ? > ) request . getBody ( ) ) . getHeaders ( ) ; for ( SoapHeader header : headers ) { if ( header . getName ( ) . getLocalPart ( ) . equals ( "MasterRequestID...
Assumes a MasterRequestID SOAP header element . Override for something different .
13,856
private boolean validate ( DefinitionsDocument defdoc ) { List < XmlError > errorList = new ArrayList < > ( ) ; XmlOptions options = new XmlOptions ( ) . setSavePrettyPrint ( ) . setSavePrettyPrintIndent ( 2 ) . setSaveAggressiveNamespaces ( ) ; options . setErrorListener ( errorList ) ; System . out . println ( "!--to...
Validates the xml after creation
13,857
public static boolean verifyClass ( String className ) { try { Class < ? > cl = Class . forName ( className ) ; cl . newInstance ( ) ; return true ; } catch ( Exception ex ) { logger . severeException ( "ApplicationContext: verifyClass(): General Exception occurred: " + ex . getMessage ( ) , ex ) ; return false ; } }
Verifies a class
13,858
public static String getAppId ( ) { if ( appId != null ) return appId ; appId = PropertyManager . getProperty ( PropertyNames . MDW_APP_ID ) ; if ( appId == null ) appId = PropertyManager . getProperty ( "mdw.application.name" ) ; if ( appId == null ) return "Unknown" ; return appId ; }
Returns the application name
13,859
public static String getAppVersion ( ) { if ( appVersion != null ) return appVersion ; String appName = getAppId ( ) ; if ( "mdw" . equalsIgnoreCase ( appName ) ) { appVersion = getMdwVersion ( ) ; } else { appVersion = "Unknown" ; try { InputStream stream = ApplicationContext . class . getClassLoader ( ) . getResource...
Returns the application version read from the build version file
13,860
public static String getServicesUrl ( ) { String servicesUrl = PropertyManager . getProperty ( PropertyNames . MDW_SERVICES_URL ) ; if ( servicesUrl == null ) { servicesUrl = getMdwHubUrl ( ) ; } if ( servicesUrl . endsWith ( "/" ) ) servicesUrl = servicesUrl . substring ( 0 , servicesUrl . length ( ) - 1 ) ; return se...
Returns the web services URL
13,861
public static String getCentralServicesUrl ( ) { String centralServicesUrl = getMdwCentralUrl ( ) ; if ( centralServicesUrl != null && centralServicesUrl . endsWith ( "/central" ) ) centralServicesUrl = centralServicesUrl . substring ( 0 , centralServicesUrl . length ( ) - 8 ) ; return centralServicesUrl ; }
Compatibility for disparities in mdw - central hosting mechanism .
13,862
public static String substitute ( String sql , Object ... params ) { try { if ( params == null || params . length == 0 ) return sql ; String subst = sql ; int start = 0 ; int q ; for ( int i = 0 ; start < subst . length ( ) && ( q = subst . indexOf ( '?' , start ) ) >= 0 ; i ++ ) { Object param = params [ i ] ; String ...
Utility method for showing parameterized query result
13,863
public static List < ExternalEvent > getPathExternalEvents ( String bucket ) { if ( myPathCache . get ( bucket ) != null ) return myPathCache . get ( bucket ) ; else if ( bucket . indexOf ( '/' ) > 0 ) { return getPathExternalEvents ( bucket . substring ( 0 , bucket . lastIndexOf ( '/' ) ) ) ; } return null ; }
returns the cached path - based external event
13,864
public JSONObject get ( String path , Map < String , String > headers ) throws ServiceException , JSONException { Asset rules = getRulesAsset ( path ) ; Operand input = new Operand ( ) ; input . setContext ( getContext ( path ) ) ; Query query = getQuery ( path , headers ) ; input . setParams ( query . getFilters ( ) )...
Apply rules designated in asset path against incoming request parameters .
13,865
@ Path ( "/{assetPath}" ) @ ApiOperation ( value = "Apply rules identified by assetPath." , notes = "Query may contain runtime values" ) @ ApiImplicitParams ( { @ ApiImplicitParam ( name = "FactsObject" , paramType = "body" , required = true , value = "Input to apply rules against" ) , @ ApiImplicitParam ( name = "asse...
Apply rules designated in asset path against incoming JSONObject .
13,866
public void execute ( ) throws ActivityException { try { String language = getLanguage ( ) ; String script = getScript ( ) ; Object retObj = executeScript ( script , language , null , null ) ; if ( retObj != null ) setReturnCode ( retObj . toString ( ) ) ; } catch ( ActivityException ex ) { throw ex ; } catch ( Excepti...
Execute scripts in supported languages .
13,867
@ SuppressWarnings ( "deprecation" ) protected Date getEndDate ( Query query ) { Instant instant = query . getInstantFilter ( "Ending" ) ; if ( instant == null ) return null ; else { Date end = new Date ( Date . from ( instant ) . getTime ( ) + DatabaseAccess . getDbTimeDiff ( ) ) ; if ( end . getHours ( ) == 0 ) { end...
This is not completion date . It s ending start date .
13,868
public void removeEventWaitForActivityInstance ( Long activityInstanceId , String reason ) throws SQLException { String query = "delete from EVENT_WAIT_INSTANCE where EVENT_WAIT_INSTANCE_OWNER_ID=?" ; db . runUpdate ( query , activityInstanceId ) ; this . recordEventHistory ( "All Events" , EventLog . SUBCAT_DEREGISTER...
remove other wait instances when an activity receives one event
13,869
private void removeEventWait ( String eventName ) throws SQLException { String query = "delete from EVENT_WAIT_INSTANCE where EVENT_NAME=?" ; db . runUpdate ( query , eventName ) ; this . recordEventHistory ( eventName , EventLog . SUBCAT_DEREGISTER , "N/A" , 0L , "Deregister all existing waiters" ) ; }
remove existing waiters when a new waiter is registered for the same event
13,870
public List < ScheduledEvent > getScheduledEventList ( Date cutofftime ) throws SQLException { StringBuffer query = new StringBuffer ( ) ; query . append ( "select EVENT_NAME,CREATE_DT,CONSUME_DT,AUXDATA,REFERENCE,COMMENTS " ) ; query . append ( "from EVENT_INSTANCE " ) ; query . append ( "where STATUS_CD in (" ) ; que...
Load all internal event and scheduled jobs before cutoff time . If cutoff time is null load only unscheduled events
13,871
public List < UnscheduledEvent > getUnscheduledEventList ( Date cutoffTime , int maxRows ) throws SQLException { StringBuffer query = new StringBuffer ( ) ; query . append ( "select EVENT_NAME,CREATE_DT,AUXDATA,REFERENCE,COMMENTS " ) ; query . append ( "from EVENT_INSTANCE " ) ; query . append ( "where STATUS_CD = " + ...
Load all internal events start at the specified age and scheduled jobs before cutoff time . If cutoff time is null load only unscheduled events
13,872
public String getVariableNameForTaskInstance ( Long taskInstId , String name ) throws SQLException { String query = "select v.VARIABLE_NAME " + "from VARIABLE v, VARIABLE_MAPPING vm, TASK t, TASK_INSTANCE ti " + "where ti.TASK_INSTANCE_ID = ?" + " and ti.TASK_ID = t.TASK_ID" + " and vm.MAPPING_OWNER = 'TASK'" + "...
Get the variable name for a task instance with Referred as name
13,873
private static void initializeLogging ( ) { try { String mdwLogLevel = LoggerUtil . initializeLogging ( ) ; if ( mdwLogLevel != null ) { LoggerContext loggerContext = ( LoggerContext ) LoggerFactory . getILoggerFactory ( ) ; loggerContext . getLogger ( "com.centurylink.mdw" ) . setLevel ( Level . toLevel ( mdwLogLevel ...
Make zero - config logback logging honor mdw . logging . level in mdw . yaml .
13,874
protected synchronized List < String > getActiveWorkerInstances ( ) { List < String > localList = new ArrayList < String > ( ) ; int activeServerInterval = PropertyManager . getIntegerProperty ( PropertyNames . MDW_ROUTING_ACTIVE_SERVER_INTERVAL , 15 ) ; if ( lastCheck == 0 || ( ( System . currentTimeMillis ( ) - lastC...
Override this to modify how active instances are determined
13,875
protected URL buildURL ( Map < String , String > headers , String instanceHostPort ) throws MalformedURLException { String origUrl = headers . get ( Listener . METAINFO_REQUEST_URL ) ; if ( origUrl == null || ! origUrl . startsWith ( "http" ) ) { return new URL ( "http://" + instanceHostPort + "/" + getServicesRoot ( )...
Override this to build the destination URL differently .
13,876
public Object toObject ( String pStr ) { String decoded = null ; try { decoded = decoder . decode ( pStr ) ; } catch ( DecoderException ex ) { ex . printStackTrace ( ) ; throw new TranslationException ( ex . getMessage ( ) ) ; } return decoded ; }
converts the passed in String to an equivalent object
13,877
protected void runScript ( String mapperScript , Slurper slurper , Builder builder ) throws ActivityException , TransformerException { CompilerConfiguration compilerConfig = new CompilerConfiguration ( ) ; compilerConfig . setScriptBaseClass ( CrossmapScript . class . getName ( ) ) ; Binding binding = new Binding ( ) ;...
Invokes the builder object for creating new output variable value .
13,878
public Map < String , String > getDocRefs ( ) { return new HashMap < String , String > ( ) { public String get ( Object varName ) { VariableInstance varInst = processInstance . getVariable ( ( String ) varName ) ; if ( varInst != null && varInst . getData ( ) instanceof DocumentReference ) return varInst . getData ( ) ...
For read - only access .
13,879
public Object getValue ( String key ) { if ( isExpression ( key ) ) return evaluate ( key ) ; else return getVariables ( ) . get ( key ) ; }
Returns a variable value . Key can be a var name or an expression .
13,880
@ ApiModelProperty ( hidden = true ) public AssetFile getAssetFile ( File file , AssetRevision rev ) throws IOException { AssetFile assetFile ; if ( rev == null ) { rev = versionControl . getRevision ( file ) ; if ( rev == null ) { rev = new AssetRevision ( ) ; rev . setVersion ( 0 ) ; rev . setModDate ( new Date ( ) )...
Called during initial load the file param is a standard file .
13,881
private void storeAttribute ( Attr attribute ) { if ( attribute . getNamespaceURI ( ) != null && attribute . getNamespaceURI ( ) . equals ( XMLConstants . XMLNS_ATTRIBUTE_NS_URI ) ) { if ( attribute . getNodeName ( ) . equals ( XMLConstants . XMLNS_ATTRIBUTE ) ) { putInCache ( DEFAULT_NS , attribute . getNodeValue ( ) ...
This method looks at an attribute and stores it if it is a namespace attribute .
13,882
public String getNamespaceURI ( String prefix ) { if ( prefix == null || prefix . equals ( XMLConstants . DEFAULT_NS_PREFIX ) ) { return prefix2Uri . get ( DEFAULT_NS ) ; } else { return prefix2Uri . get ( prefix ) ; } }
This method is called by XPath . It returns the default namespace if the prefix is null or .
13,883
public Object getObject ( String type , Package pkg ) { if ( type == null || type . equals ( documentType ) ) { if ( object == null && content != null ) { object = VariableTranslator . realToObject ( pkg , documentType , content ) ; } } else { if ( content != null ) { documentType = type ; object = VariableTranslator ....
content in object format
13,884
public boolean isGroupMapped ( String pGroupName ) { List < String > userGroups = this . getUserGroups ( ) ; for ( String g : userGroups ) { if ( g . equals ( pGroupName ) ) return true ; } return false ; }
Checked if the passed in GroupIName is mapped to the task
13,885
public boolean isVariableMapped ( String pVarName ) { if ( variables == null ) { return false ; } for ( Variable vo : variables ) { if ( vo . getName ( ) . equals ( pVarName ) ) { return true ; } } return false ; }
Checked if the passed in Var Name is mapped to the task
13,886
protected SOAPMessage createSoapRequest ( Object requestObj ) throws ActivityException { try { MessageFactory messageFactory = getSoapMessageFactory ( ) ; SOAPMessage soapMessage = messageFactory . createMessage ( ) ; Map < Name , String > soapReqHeaders = getSoapRequestHeaders ( ) ; if ( soapReqHeaders != null ) { SOA...
Create the SOAP request object based on the document variable value .
13,887
public void removeAttribute ( String name ) { if ( getAttributes ( ) != null ) { List < Attribute > toRemove = new ArrayList < Attribute > ( ) ; for ( Attribute attr : getAttributes ( ) ) { if ( attr . getAttributeName ( ) . equals ( name ) ) toRemove . add ( attr ) ; } for ( Attribute attr : toRemove ) getAttributes (...
Takes care of multiples .
13,888
public static int parseVersionSpec ( String versionString ) throws NumberFormatException { if ( versionString == null ) return 0 ; int dot = versionString . indexOf ( '.' ) ; int major , minor ; if ( dot > 0 ) { major = Integer . parseInt ( versionString . substring ( 0 , dot ) ) ; minor = Integer . parseInt ( versionS...
single digit without decimal means a major version not minor
13,889
public static String getFormat ( String fileName ) { int lastDot = fileName . lastIndexOf ( '.' ) ; if ( lastDot == - 1 ) return null ; return getLanguage ( fileName . substring ( lastDot ) ) ; }
Takes into account special rules due to multiple languages per extension .
13,890
public VariableTranslator getDynamicVariableTranslator ( String className , ClassLoader parentLoader ) { try { Class < ? > clazz = CompiledJavaCache . getClassFromAssetName ( parentLoader , className ) ; if ( clazz != null ) return ( VariableTranslator ) ( clazz ) . newInstance ( ) ; } catch ( Exception ex ) { logger ....
To get dynamic java variable translator
13,891
public void onShutdown ( ) { if ( instance == null ) return ; try { this . camelContext . stop ( ) ; } catch ( Exception ex ) { logger . severeException ( ex . getMessage ( ) , ex ) ; } }
Method can be invoked when the server shuts down
13,892
public static String evaluate ( XmlObject xmlbean , String path ) { XmlCursor cursor = xmlbean . newCursor ( ) ; String value ; try { XmlPath matcher = new XmlPath ( path ) ; value = matcher . evaluate_segment ( cursor , matcher . path_seg ) ; } catch ( XmlException e ) { value = null ; } cursor . dispose ( ) ; return ...
Using XPath or XQuery . NOTE!!!! To use this code need to include xbean_xpath . jar saxon9 . jar saxon9 - dom . jar in CLASSPATH in startWebLogic . cmd
13,893
protected void parseGroupMap ( Map < String , Object > groupMap , Map < String , String > resultMap , String prefix ) { Object obj ; for ( String groupKey : groupMap . keySet ( ) ) { obj = groupMap . get ( groupKey ) ; String key = prefix == null ? groupKey : prefix + "." + groupKey ; if ( obj instanceof Map ) parseGro...
Flattens the group map
13,894
protected Integer notifyProcesses ( String eventName , Long eventInstId , String message , int delay ) { Integer status ; try { EventServices eventManager = ServiceLocator . getEventServices ( ) ; status = eventManager . notifyProcess ( eventName , eventInstId , message , delay ) ; } catch ( Exception e ) { logger . se...
This method is used to wake up existing process instances .
13,895
protected DocumentReference createDocument ( String docType , Object document , String ownerType , Long ownerId , Long processInstanceId , String searchKey1 , String searchKey2 ) throws EventHandlerException { ListenerHelper helper = new ListenerHelper ( ) ; return helper . createDocument ( docType , document , getPack...
This method is used to create a document from external messages . The document reference returned can be sent as parameters to start or inform processes .
13,896
protected Object getRequestData ( ) throws ActivityException { String varname = getAttributeValue ( REQUEST_VARIABLE ) ; Object request = varname == null ? null : getParameterValue ( varname ) ; if ( ! StringHelper . isEmpty ( getPreScript ( ) ) ) { Object returnVal = executePreScript ( request ) ; if ( returnVal == nu...
Override this method if need to translate data from variable or need to get data elsewhere . The default method assumes the data is in the variable REQUEST_VARIABLE
13,897
protected Response getStubbedResponse ( Object requestObject ) { String resp = getStubResponse ( externalRequestToString ( requestObject ) ) ; if ( resp != null ) { Response oldStubbed = new Response ( ) ; oldStubbed . setObject ( resp ) ; oldStubbed . setContent ( externalResponseToString ( resp ) ) ; return oldStubbe...
Return stubbed response from external system .
13,898
protected Map < String , Object > getPreScriptBindings ( Object request ) throws ActivityException { Map < String , Object > binding = new HashMap < String , Object > ( ) ; String requestVar = this . getAttributeValue ( REQUEST_VARIABLE ) ; if ( requestVar != null && request instanceof String ) { binding . put ( "reque...
Extra bindings for pre - script beyond process variable values .
13,899
protected Map < String , Object > getPostScriptBindings ( Object response ) throws ActivityException { Map < String , Object > binding = new HashMap < String , Object > ( ) ; String varname = this . getAttributeValue ( RESPONSE_VARIABLE ) ; if ( varname != null && response instanceof String ) { binding . put ( "respons...
Extra bindings for post - script beyond process variable values .