idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
10,200
public String resolveExpressionOfEventName ( VariableScope scope ) { if ( isExpressionAvailable ( ) ) { return ( String ) eventName . getValue ( scope ) ; } else { return null ; } }
Resolves the event name within the given scope .
10,201
public static AttributeDefinition [ ] getValueTypes ( Object instance , Class clazz ) { try { if ( ObjectTypeAttributeDefinition . class . isAssignableFrom ( clazz ) ) { Field valueTypesField = clazz . getDeclaredField ( "valueTypes" ) ; valueTypesField . setAccessible ( true ) ; Object value = valueTypesField . get ( ...
Obtain the valueTypes of the ObjectTypeAttributeDefinition through reflection because they are private in Wildfly 8 .
10,202
protected void cascadeDeleteProcessInstancesForProcessDefinition ( String processDefinitionId , boolean skipCustomListeners , boolean skipIoMappings ) { getProcessInstanceManager ( ) . deleteProcessInstancesByProcessDefinition ( processDefinitionId , "deleted process definition" , true , skipCustomListeners , skipIoMap...
Cascades the deletion of the process definition to the process instances . Skips the custom listeners if the flag was set to true .
10,203
protected void cascadeDeleteHistoryForProcessDefinition ( String processDefinitionId ) { getHistoricIncidentManager ( ) . deleteHistoricIncidentsByProcessDefinitionId ( processDefinitionId ) ; getHistoricIdentityLinkManager ( ) . deleteHistoricIdentityLinksLogByProcessDefinitionId ( processDefinitionId ) ; getHistoricJ...
Cascades the deletion of a process definition to the history deletes the history .
10,204
protected void deleteTimerStartEventsForProcessDefinition ( ProcessDefinition processDefinition ) { List < JobEntity > timerStartJobs = getJobManager ( ) . findJobsByConfiguration ( TimerStartEventJobHandler . TYPE , processDefinition . getKey ( ) , processDefinition . getTenantId ( ) ) ; ProcessDefinitionEntity latest...
Deletes the timer start events for the given process definition .
10,205
public void deleteSubscriptionsForProcessDefinition ( String processDefinitionId ) { List < EventSubscriptionEntity > eventSubscriptionsToRemove = new ArrayList < EventSubscriptionEntity > ( ) ; List < EventSubscriptionEntity > messageEventSubscriptions = getEventSubscriptionManager ( ) . findEventSubscriptionsByConfig...
Deletes the subscriptions for the process definition which is identified by the given process definition id .
10,206
public void deleteProcessDefinition ( ProcessDefinition processDefinition , String processDefinitionId , boolean cascadeToHistory , boolean cascadeToInstances , boolean skipCustomListeners , boolean skipIoMappings ) { if ( cascadeToHistory ) { cascadeDeleteHistoryForProcessDefinition ( processDefinitionId ) ; if ( casc...
Deletes the given process definition from the database and cache . If cascadeToHistory and cascadeToInstances is set to true it deletes the history and the process instances .
10,207
public void deleteHistoricTaskInstancesByProcessInstanceIds ( List < String > processInstanceIds , boolean deleteVariableInstances ) { CommandContext commandContext = Context . getCommandContext ( ) ; if ( deleteVariableInstances ) { getHistoricVariableInstanceManager ( ) . deleteHistoricVariableInstancesByTaskProcessI...
Deletes all data related with tasks which belongs to specified process instance ids .
10,208
protected void initCommandExecutorDbSchemaOperations ( ) { if ( commandExecutorSchemaOperations == null ) { List < CommandInterceptor > commandInterceptorsDbSchemaOperations = new ArrayList < CommandInterceptor > ( ) ; commandInterceptorsDbSchemaOperations . add ( new LogInterceptor ( ) ) ; commandInterceptorsDbSchemaO...
provide custom command executor that uses NON - JTA transactions
10,209
public ScriptEngine getScriptEngineForLanguage ( String language ) { if ( language != null ) { language = language . toLowerCase ( ) ; } ProcessApplicationReference pa = Context . getCurrentProcessApplication ( ) ; ProcessEngineConfigurationImpl config = Context . getProcessEngineConfiguration ( ) ; ScriptEngine engine...
Loads the given script engine by language name . Will throw an exception if no script engine can be loaded for the given language name .
10,210
public Bindings createBindings ( ScriptEngine scriptEngine , VariableScope variableScope ) { return scriptBindingsFactory . createBindings ( variableScope , scriptEngine . createBindings ( ) ) ; }
override to build a spring aware ScriptingEngines
10,211
public void destroy ( ) { ensureParentInitialized ( ) ; ensureActivityInitialized ( ) ; if ( activity != null && activity . getIoMapping ( ) != null && ! skipIoMapping ) { activity . getIoMapping ( ) . executeOutputParameters ( this ) ; } clearExecution ( ) ; super . destroy ( ) ; removeEventSubscriptionsExceptCompensa...
Method used for destroying a scope in a way that the execution can be removed afterwards .
10,212
protected void ensureProcessDefinitionInitialized ( ) { if ( ( processDefinition == null ) && ( processDefinitionId != null ) ) { ProcessDefinitionEntity deployedProcessDefinition = Context . getProcessEngineConfiguration ( ) . getDeploymentCache ( ) . findDeployedProcessDefinitionById ( processDefinitionId ) ; setProc...
for setting the process definition this setter must be used as subclasses can override
10,213
protected void ensureExecutionTreeInitialized ( ) { List < ExecutionEntity > executions = Context . getCommandContext ( ) . getExecutionManager ( ) . findExecutionsByProcessInstanceId ( processInstanceId ) ; ExecutionEntity processInstance = isProcessInstanceExecution ( ) ? this : null ; if ( processInstance == null ) ...
Fetch all the executions inside the same process instance as list and then reconstruct the complete execution tree .
10,214
@ SuppressWarnings ( "unchecked" ) public < T > List < T > get ( PropertyListKey < T > property ) { if ( contains ( property ) ) { return ( List < T > ) properties . get ( property . getName ( ) ) ; } else { return new ArrayList < T > ( ) ; } }
Returns the list to which the specified property key is mapped or an empty list if this properties contains no mapping for the property key . Note that the empty list is not mapped to the property key .
10,215
@ SuppressWarnings ( "unchecked" ) public < K , V > Map < K , V > get ( PropertyMapKey < K , V > property ) { if ( contains ( property ) ) { return ( Map < K , V > ) properties . get ( property . getName ( ) ) ; } else { return new HashMap < K , V > ( ) ; } }
Returns the map to which the specified property key is mapped or an empty map if this properties contains no mapping for the property key . Note that the empty map is not mapped to the property key .
10,216
public < T > void set ( PropertyKey < T > property , T value ) { properties . put ( property . getName ( ) , value ) ; }
Associates the specified value with the specified property key . If the properties previously contained a mapping for the property key the old value is replaced by the specified value .
10,217
public < T > void set ( PropertyListKey < T > property , List < T > value ) { properties . put ( property . getName ( ) , value ) ; }
Associates the specified list with the specified property key . If the properties previously contained a mapping for the property key the old value is replaced by the specified list .
10,218
public < K , V > void set ( PropertyMapKey < K , V > property , Map < K , V > value ) { properties . put ( property . getName ( ) , value ) ; }
Associates the specified map with the specified property key . If the properties previously contained a mapping for the property key the old value is replaced by the specified map .
10,219
public < T > void addListItem ( PropertyListKey < T > property , T value ) { List < T > list = get ( property ) ; list . add ( value ) ; if ( ! contains ( property ) ) { set ( property , list ) ; } }
Append the value to the list to which the specified property key is mapped . If this properties contains no mapping for the property key the value append to a new list witch is associate the the specified property key .
10,220
public < K , V > void putMapEntry ( PropertyMapKey < K , V > property , K key , V value ) { Map < K , V > map = get ( property ) ; if ( ! property . allowsOverwrite ( ) && map . containsKey ( key ) ) { throw new ProcessEngineException ( "Cannot overwrite property key " + key + ". Key already exists" ) ; } map . put ( k...
Insert the value to the map to which the specified property key is mapped . If this properties contains no mapping for the property key the value insert to a new map witch is associate the the specified property key .
10,221
protected void checkJavaSerialization ( String variableName , TypedValue value ) { ProcessEngineConfigurationImpl processEngineConfiguration = Context . getProcessEngineConfiguration ( ) ; if ( value instanceof SerializableValue && ! processEngineConfiguration . isJavaSerializationFormatEnabled ( ) ) { SerializableValu...
Checks if Java serialization will be used and if it is allowed to be used .
10,222
public static boolean isArrayByteBase64 ( byte [ ] arrayOctet ) { for ( int i = 0 ; i < arrayOctet . length ; i ++ ) { if ( ! isBase64 ( arrayOctet [ i ] ) && ! isWhiteSpace ( arrayOctet [ i ] ) ) { return false ; } } return true ; }
Tests a given byte array to see if it contains only valid characters within the Base64 alphabet . Currently the method treats whitespace as valid .
10,223
protected ProcessApplicationInterface lookupSelfReference ( ) { try { InitialContext ic = new InitialContext ( ) ; SessionContext sctxLookup = ( SessionContext ) ic . lookup ( EJB_CONTEXT_PATH ) ; return sctxLookup . getBusinessObject ( getBusinessInterface ( ) ) ; } catch ( NamingException e ) { throw LOG . ejbPaCanno...
lookup a proxy object representing the invoked business view of this component .
10,224
protected String lookupEeApplicationName ( ) { try { InitialContext initialContext = new InitialContext ( ) ; String appName = ( String ) initialContext . lookup ( JAVA_APP_APP_NAME_PATH ) ; String moduleName = ( String ) initialContext . lookup ( MODULE_NAME_PATH ) ; if ( moduleName != null && ! moduleName . equals ( ...
determine the ee application name based on information obtained from JNDI .
10,225
public CoreActivity findActivity ( String activityId ) { CoreActivity localActivity = getChildActivity ( activityId ) ; if ( localActivity != null ) { return localActivity ; } for ( CoreActivity activity : getActivities ( ) ) { CoreActivity nestedActivity = activity . findActivity ( activityId ) ; if ( nestedActivity !...
searches for the activity recursively
10,226
protected static boolean checkDiagram ( String fileName , String modelFileName , String [ ] diagramSuffixes , String [ ] modelSuffixes ) { for ( String modelSuffix : modelSuffixes ) { if ( modelFileName . endsWith ( modelSuffix ) ) { String caseFilePrefix = modelFileName . substring ( 0 , modelFileName . length ( ) - m...
Checks whether a filename is a diagram for the given modelFileName .
10,227
protected String extractEngineName ( String requestUrl ) { Matcher matcher = ENGINE_REQUEST_URL_PATTERN . matcher ( requestUrl ) ; if ( matcher . find ( ) ) { return matcher . group ( 1 ) ; } else { return DEFAULT_ENGINE_NAME ; } }
May not return null
10,228
public static Element findCamundaExtensionElement ( Element element , String extensionElementName ) { Element extensionElements = element . element ( "extensionElements" ) ; if ( extensionElements != null ) { return extensionElements . elementNS ( BpmnParse . CAMUNDA_BPMN_EXTENSIONS_NS , extensionElementName ) ; } else...
Returns the camunda extension element in the camunda namespace and the given name .
10,229
public static ExecutableScript parseCamundaScript ( Element scriptElement ) { String scriptLanguage = scriptElement . attribute ( "scriptFormat" ) ; if ( scriptLanguage == null || scriptLanguage . isEmpty ( ) ) { throw new BpmnParseException ( "Missing attribute 'scriptFormatAttribute' for 'script' element" , scriptEle...
Parses a camunda script element .
10,230
protected List < EventSubscriptionEntity > filterSubscriptionsOfDifferentType ( EventSubscriptionDeclaration eventSubscription , List < EventSubscriptionEntity > subscriptionsForSameMessageName ) { ArrayList < EventSubscriptionEntity > filteredSubscriptions = new ArrayList < EventSubscriptionEntity > ( subscriptionsFor...
It is possible to deploy a process containing a start and intermediate message event that wait for the same message or to have two processes one with a message start event and the other one with a message intermediate event that subscribe for the same message . Therefore we have to find out if there are subscriptions f...
10,231
public void setFunction ( String prefix , String localName , Method method ) { if ( functions == null ) { functions = new Functions ( ) ; } functions . setFunction ( prefix , localName , method ) ; }
Define a function .
10,232
public ValueExpression setVariable ( String name , ValueExpression expression ) { if ( variables == null ) { variables = new Variables ( ) ; } return variables . setVariable ( name , expression ) ; }
Define a variable .
10,233
public boolean isCompensationHandler ( ) { Boolean isForCompensation = ( Boolean ) getProperty ( BpmnParse . PROPERTYNAME_IS_FOR_COMPENSATION ) ; return Boolean . TRUE . equals ( isForCompensation ) ; }
Indicates whether activity is for compensation .
10,234
public ActivityImpl findCompensationHandler ( ) { String compensationHandlerId = ( String ) getProperty ( BpmnParse . PROPERTYNAME_COMPENSATION_HANDLER_ID ) ; if ( compensationHandlerId != null ) { return getProcessDefinition ( ) . findActivity ( compensationHandlerId ) ; } else { return null ; } }
Find the compensation handler of this activity .
10,235
public boolean isMultiInstance ( ) { Boolean isMultiInstance = ( Boolean ) getProperty ( BpmnParse . PROPERTYNAME_IS_MULTI_INSTANCE ) ; return Boolean . TRUE . equals ( isMultiInstance ) ; }
Indicates whether activity is a multi instance activity .
10,236
protected DbEntity cacheFilter ( DbEntity persistentObject ) { DbEntity cachedPersistentObject = dbEntityCache . get ( persistentObject . getClass ( ) , persistentObject . getId ( ) ) ; if ( cachedPersistentObject != null ) { return cachedPersistentObject ; } else { return persistentObject ; } }
returns the object in the cache . if this object was loaded before then the original object is returned .
10,237
private DbOperation hasOptimisticLockingException ( List < DbOperation > operationsToFlush , Throwable cause ) { BatchExecutorException batchExecutorException = ExceptionUtil . findBatchExecutorException ( cause ) ; if ( batchExecutorException != null ) { int failedOperationIndex = batchExecutorException . getSuccessfu...
An OptimisticLockingException check for batch processing
10,238
public Object getValue ( ELContext context , Object base , Object property ) { if ( context == null ) { throw new NullPointerException ( ) ; } Object result = null ; if ( isResolvable ( base ) ) { Method method = toBeanProperty ( base , property ) . getReadMethod ( ) ; if ( method == null ) { throw new PropertyNotFound...
If the base object is not null returns the current value of the given property on this bean . If the base is not null the propertyResolved property of the ELContext object must be set to true by this resolver before returning . If this property is not true after this method is called the caller should ignore the return...
10,239
protected boolean supportsConcurrentChildInstantiation ( ScopeImpl flowScope ) { CoreActivityBehavior < ? > behavior = flowScope . getActivityBehavior ( ) ; return behavior == null || ! ( behavior instanceof SequentialMultiInstanceActivityBehavior ) ; }
Cannot create more than inner instance in a sequential MI construct
10,240
public void startTaskForm ( ) { Map < String , String > requestParameterMap = FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . getRequestParameterMap ( ) ; String taskId = requestParameterMap . get ( "taskId" ) ; String callbackUrl = requestParameterMap . get ( "callbackUrl" ) ; if ( taskId == null || c...
Get taskId and callBackUrl from request and start a conversation to start the form
10,241
public void startProcessInstanceByIdForm ( ) { if ( FacesContext . getCurrentInstance ( ) . isPostback ( ) ) { return ; } Map < String , String > requestParameterMap = FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . getRequestParameterMap ( ) ; String processDefinitionId = requestParameterMap . get ( "...
Get processDefinitionId and callbackUrl from request and start a conversation to start the form
10,242
public void startProcessInstanceByKeyForm ( ) { if ( FacesContext . getCurrentInstance ( ) . isPostback ( ) ) { return ; } Map < String , String > requestParameterMap = FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . getRequestParameterMap ( ) ; String processDefinitionKey = requestParameterMap . get (...
Get processDefinitionKey and callbackUrl from request and start a conversation to start the form
10,243
public Object getValue ( ELContext context , Object base , Object property ) { if ( context == null ) { throw new NullPointerException ( "context is null" ) ; } Object result = null ; if ( isResolvable ( base ) ) { if ( property != null ) { try { result = ( ( ResourceBundle ) base ) . getObject ( property . toString ( ...
If the base object is an instance of ResourceBundle the provided property will first be coerced to a String . The Object returned by getObject on the base ResourceBundle will be returned . If the base is ResourceBundle the propertyResolved property of the ELContext object must be set to true by this resolver before ret...
10,244
@ SuppressWarnings ( "unchecked" ) public < T extends DbEntity > T get ( Class < T > type , String id ) { Class < ? > cacheKey = cacheKeyMapping . getEntityCacheKey ( type ) ; CachedDbEntity cachedDbEntity = getCachedEntity ( cacheKey , id ) ; if ( cachedDbEntity != null ) { DbEntity dbEntity = cachedDbEntity . getEnti...
get an object from the cache
10,245
public CachedDbEntity getCachedEntity ( Class < ? > type , String id ) { Class < ? > cacheKey = cacheKeyMapping . getEntityCacheKey ( type ) ; Map < String , CachedDbEntity > entitiesByType = cachedEntites . get ( cacheKey ) ; if ( entitiesByType != null ) { return entitiesByType . get ( id ) ; } else { return null ; }...
Looks up an entity in the cache .
10,246
public boolean remove ( DbEntity e ) { Class < ? > cacheKey = cacheKeyMapping . getEntityCacheKey ( e . getClass ( ) ) ; Map < String , CachedDbEntity > typeMap = cachedEntites . get ( cacheKey ) ; if ( typeMap != null ) { return typeMap . remove ( e . getId ( ) ) != null ; } else { return false ; } }
Remove an entity from the cache
10,247
public boolean isDeleted ( DbEntity dbEntity ) { CachedDbEntity cachedDbEntity = getCachedEntity ( dbEntity ) ; if ( cachedDbEntity == null ) { return false ; } else { return cachedDbEntity . getEntityState ( ) == DELETED_MERGED || cachedDbEntity . getEntityState ( ) == DELETED_PERSISTENT || cachedDbEntity . getEntityS...
Allows checking whether the provided entity is present in the cache and is marked to be deleted .
10,248
public void setDeleted ( DbEntity dbEntity ) { CachedDbEntity cachedEntity = getCachedEntity ( dbEntity ) ; if ( cachedEntity != null ) { if ( cachedEntity . getEntityState ( ) == TRANSIENT ) { cachedEntity . setEntityState ( DELETED_TRANSIENT ) ; } else if ( cachedEntity . getEntityState ( ) == PERSISTENT ) { cachedEn...
Sets an object to a deleted state . It will not be removed from the cache but transition to one of the DELETED states depending on it s current state .
10,249
@ SuppressWarnings ( "unchecked" ) public List < EventSubscriptionEntity > findSignalEventSubscriptionsByEventName ( String eventName ) { final String query = "selectSignalEventSubscriptionsByEventName" ; Set < EventSubscriptionEntity > eventSubscriptions = new HashSet < EventSubscriptionEntity > ( getDbEntityManager (...
Find all signal event subscriptions with the given event name for any tenant .
10,250
@ SuppressWarnings ( "unchecked" ) public List < EventSubscriptionEntity > findSignalEventSubscriptionsByEventNameAndTenantId ( String eventName , String tenantId ) { final String query = "selectSignalEventSubscriptionsByEventNameAndTenantId" ; Map < String , Object > parameter = new HashMap < String , Object > ( ) ; p...
Find all signal event subscriptions with the given event name and tenant .
10,251
public static URI urlToURI ( URL url ) { try { return url . toURI ( ) ; } catch ( URISyntaxException e ) { throw LOG . cannotConvertUrlToUri ( url , e ) ; } }
Converts an url to an uri . Escapes whitespaces if needed .
10,252
public static Field getField ( String fieldName , Class < ? > clazz ) { Field field = null ; try { field = clazz . getDeclaredField ( fieldName ) ; } catch ( SecurityException e ) { throw LOG . unableToAccessField ( field , clazz . getName ( ) ) ; } catch ( NoSuchFieldException e ) { Class < ? > superClass = clazz . ge...
Returns the field of the given class or null if it doesnt exist .
10,253
public static Method getSingleSetter ( String fieldName , Class < ? > clazz ) { String setterName = buildSetterName ( fieldName ) ; try { Method [ ] methods = clazz . getMethods ( ) ; List < Method > candidates = new ArrayList < Method > ( ) ; Set < Class < ? > > parameterTypes = new HashSet < Class < ? > > ( ) ; for (...
Returns a setter method based on the fieldName and the java beans setter naming convention or null if none exists . If multiple setters with different parameter types are present an exception is thrown . If they have the same parameter type one of those methods is returned .
10,254
public static Method getMethod ( Class < ? > declaringType , String methodName , Class < ? > ... parameterTypes ) { return findMethod ( declaringType , methodName , parameterTypes ) ; }
Finds a method by name and parameter types .
10,255
public static LockedExternalTaskImpl fromEntity ( ExternalTaskEntity externalTaskEntity , List < String > variablesToFetch , boolean isLocal , boolean deserializeVariables ) { LockedExternalTaskImpl result = new LockedExternalTaskImpl ( ) ; result . id = externalTaskEntity . getId ( ) ; result . topicName = externalTas...
Construct representation of locked ExternalTask from corresponding entity . During mapping variables will be collected during collection variables will not be deserialized and scope will not be set to local .
10,256
public static void addServerExecutorDependency ( ServiceBuilder < ? > serviceBuilder , InjectedValue < ExecutorService > injector , boolean optional ) { ServiceBuilder . DependencyType type = optional ? ServiceBuilder . DependencyType . OPTIONAL : ServiceBuilder . DependencyType . REQUIRED ; serviceBuilder . addDepende...
Adds the JBoss server executor as a dependency to the given service . Copied from org . jboss . as . server . Services - JBoss 7 . 2 . 0 . Final
10,257
protected String checkForMariaDb ( DatabaseMetaData databaseMetaData , String databaseName ) { try { String databaseProductVersion = databaseMetaData . getDatabaseProductVersion ( ) ; if ( databaseProductVersion != null && databaseProductVersion . toLowerCase ( ) . contains ( "mariadb" ) ) { return MARIA_DB_PRODUCT_NAM...
The product name of mariadb is still MySQL . This method tries if it can find some evidence for mariadb . If it is successful it will return MariaDB otherwise the provided database name .
10,258
protected void ensurePrefixAndSchemaFitToegether ( String prefix , String schema ) { if ( schema == null ) { return ; } else if ( prefix == null || ( prefix != null && ! prefix . startsWith ( schema + "." ) ) ) { throw new ProcessEngineException ( "When setting a schema the prefix has to be schema + '.'. Received schem...
When providing a schema and a prefix the prefix has to be the schema ending with a dot .
10,259
public void propagateBpmnError ( BpmnError error , ActivityExecution execution ) throws Exception { super . propagateBpmnError ( error , execution ) ; }
Overrides the propagateBpmnError method to made it public . Is used to propagate the bpmn error from an external task .
10,260
public void associateExecutionById ( String executionId ) { Execution execution = processEngine . getRuntimeService ( ) . createExecutionQuery ( ) . executionId ( executionId ) . singleResult ( ) ; if ( execution == null ) { throw new ProcessEngineCdiException ( "Cannot associate execution by id: no execution with id '...
Associate with the provided execution . This starts a unit of work .
10,261
public void saveTask ( ) { assertCommandContextNotActive ( ) ; assertTaskAssociated ( ) ; final Task task = getTask ( ) ; processEngine . getTaskService ( ) . saveTask ( task ) ; }
Save the currently associated task .
10,262
public String getProcessInstanceId ( ) { Execution execution = associationManager . getExecution ( ) ; return execution != null ? execution . getProcessInstanceId ( ) : null ; }
Returns the id of the currently associated process instance or null
10,263
public String getTaskId ( ) { Task task = getTask ( ) ; return task != null ? task . getId ( ) : null ; }
Returns the id of the task associated with the current conversation or null .
10,264
protected Task getTaskById ( String id ) { return engine . getTaskService ( ) . createTaskQuery ( ) . taskId ( id ) . initializeFormKeys ( ) . singleResult ( ) ; }
Returns the task with the given id
10,265
public void failed ( String errorMessage , String errorDetails , int retries , long retryDuration ) { ensureActive ( ) ; this . setErrorMessage ( errorMessage ) ; if ( errorDetails != null ) { setErrorDetails ( errorDetails ) ; } this . lockExpirationTime = new Date ( ClockUtil . getCurrentTime ( ) . getTime ( ) + retr...
process failed state make sure that binary entity is created for the errorMessage shortError message does not exceed limit handle properly retry counts and incidents
10,266
protected void addSortedModifications ( List < DbOperation > flush ) { SortedSet < Class < ? > > modifiedEntityTypes = new TreeSet < Class < ? > > ( MODIFICATION_TYPE_COMPARATOR ) ; modifiedEntityTypes . addAll ( updates . keySet ( ) ) ; modifiedEntityTypes . addAll ( deletes . keySet ( ) ) ; modifiedEntityTypes . addA...
Adds a correctly ordered list of UPDATE and DELETE operations to the flush .
10,267
public void createLink ( HalRelation rel , String ... pathParams ) { if ( pathParams != null && pathParams . length > 0 && pathParams [ 0 ] != null ) { Set < String > linkedResourceIds = linkedResources . get ( rel ) ; if ( linkedResourceIds == null ) { linkedResourceIds = new HashSet < String > ( ) ; linkedResources ....
Creates a link in a given relation .
10,268
public List < HalResource < ? > > resolve ( HalRelation relation , ProcessEngine processEngine ) { HalLinkResolver linkResolver = hal . getLinkResolver ( relation . resourceType ) ; if ( linkResolver != null ) { Set < String > linkedIds = getLinkedResourceIdsByRelation ( relation ) ; if ( ! linkedIds . isEmpty ( ) ) { ...
Resolves a relation . Locates a HalLinkResolver for resolving the set of all linked resources in the relation .
10,269
public void mergeLinks ( HalResource < ? > embedded ) { for ( Entry < HalRelation , Set < String > > linkentry : embedded . linker . linkedResources . entrySet ( ) ) { Set < String > linkedIdSet = linkedResources . get ( linkentry . getKey ( ) ) ; if ( linkedIdSet != null ) { linkedIdSet . addAll ( linkentry . getValue...
merge the links of an embedded resource into this linker . This is useful when building resources which are actually resource collections . You can then merge the relations of all resources in the collection and the unique the set of linked resources to embed .
10,270
protected boolean isLeaf ( ExecutionEntity execution ) { if ( CompensationBehavior . isCompensationThrowing ( execution ) ) { return true ; } else { return ! execution . isEventScope ( ) && execution . getNonEventScopeExecutions ( ) . isEmpty ( ) ; } }
event - scope executions are not considered in this mapping and must be ignored
10,271
public static byte [ ] toByteArray ( String string ) { EnsureUtil . ensureActiveCommandContext ( "StringUtil.toByteArray" ) ; ProcessEngineConfigurationImpl processEngineConfiguration = Context . getProcessEngineConfiguration ( ) ; return toByteArray ( string , processEngineConfiguration . getProcessEngine ( ) ) ; }
Gets the bytes from a string using the current process engine s default charset
10,272
public static byte [ ] toByteArray ( String string , ProcessEngine processEngine ) { ProcessEngineConfigurationImpl processEngineConfiguration = ( ( ProcessEngineImpl ) processEngine ) . getProcessEngineConfiguration ( ) ; Charset charset = processEngineConfiguration . getDefaultCharset ( ) ; return string . getBytes (...
Gets the bytes from a string using the provided process engine s default charset
10,273
public static ByteArrayEntity createExceptionByteArray ( String name , byte [ ] byteArray , ResourceType type ) { ByteArrayEntity result = null ; if ( byteArray != null ) { result = new ByteArrayEntity ( name , byteArray , type ) ; Context . getCommandContext ( ) . getByteArrayManager ( ) . insertByteArray ( result ) ;...
create ByteArrayEntity with specified name and payload and make sure it s persisted
10,274
public void updateModifiableFieldsFromEntity ( DecisionDefinitionEntity updatingDecisionDefinition ) { if ( this . key . equals ( updatingDecisionDefinition . key ) && this . deploymentId . equals ( updatingDecisionDefinition . deploymentId ) ) { this . revision = updatingDecisionDefinition . revision ; this . historyT...
Updates all modifiable fields from another decision definition entity .
10,275
protected void migrateProcessInstance ( MigratingProcessInstance migratingProcessInstance ) { MigratingActivityInstance rootActivityInstance = migratingProcessInstance . getRootInstance ( ) ; MigratingProcessElementInstanceTopDownWalker walker = new MigratingProcessElementInstanceTopDownWalker ( rootActivityInstance ) ...
Migrate activity instances to their new activities and process definition . Creates new scope instances as necessary .
10,276
public Map < String , List < VariableListener < ? > > > getVariableListeners ( String eventName , boolean includeCustomListeners ) { Map < String , Map < String , List < VariableListener < ? > > > > listenerCache ; if ( includeCustomListeners ) { if ( resolvedVariableListeners == null ) { resolvedVariableListeners = ne...
Returns a map of all variable listeners defined on this activity or any of its parents activities . The map s key is the id of the respective activity the listener is defined on .
10,277
public static Object convertToClass ( String value , Class < ? > clazz ) { Object propertyValue ; if ( clazz . isAssignableFrom ( int . class ) ) { propertyValue = Integer . parseInt ( value ) ; } else if ( clazz . isAssignableFrom ( long . class ) ) { propertyValue = Long . parseLong ( value ) ; } else if ( clazz . is...
Converts a value to the type of the given field .
10,278
public static void applyProperties ( Object configuration , Map < String , String > properties ) { for ( Map . Entry < String , String > property : properties . entrySet ( ) ) { applyProperty ( configuration , property . getKey ( ) , property . getValue ( ) ) ; } }
Sets an objects fields via reflection from String values . Depending on the field s type the respective values are converted to int or boolean .
10,279
protected void loadChildExecutionsFromCache ( ExecutionEntity execution , List < ExecutionEntity > childExecutions ) { List < ExecutionEntity > childrenOfThisExecution = execution . getExecutions ( ) ; if ( childrenOfThisExecution != null ) { childExecutions . addAll ( childrenOfThisExecution ) ; for ( ExecutionEntity ...
Loads all executions that are part of this process instance tree from the dbSqlSession cache . ( optionally querying the db if a child is not already loaded .
10,280
@ SuppressWarnings ( "unchecked" ) public T embed ( HalRelation relation , ProcessEngine processEngine ) { List < HalResource < ? > > resolvedLinks = linker . resolve ( relation , processEngine ) ; if ( resolvedLinks != null && resolvedLinks . size ( ) > 0 ) { addEmbedded ( relation . relName , resolvedLinks ) ; } retu...
Can be used to embed a relation . Embedded all linked resources in the given relation .
10,281
private static OptimisticLockingException callFailedJobListenerWithRetries ( CommandExecutor commandExecutor , FailedJobListener failedJobListener ) { try { commandExecutor . execute ( failedJobListener ) ; return null ; } catch ( OptimisticLockingException ex ) { failedJobListener . incrementCountRetries ( ) ; if ( fa...
Calls FailedJobListener in case of OptimisticLockException retries configured amount of times .
10,282
public void addLocation ( TaintLocation location , boolean isKnownTaintSource ) { Objects . requireNonNull ( location , "location is null" ) ; if ( isKnownTaintSource ) { taintLocations . add ( location ) ; } else { unknownLocations . add ( location ) ; } }
Adds location for a taint source or path to remember for reporting
10,283
public boolean hasOneTag ( Tag ... tags ) { for ( Tag t : tags ) { if ( this . tags . contains ( t ) ) return true ; } return false ; }
Checks whether one of the specified taint tag is present for this fact
10,284
public static Taint valueOf ( State state ) { Objects . requireNonNull ( state , "state is null" ) ; if ( state == State . INVALID ) { return null ; } return new Taint ( state ) ; }
Constructs a new instance of taint from the specified state
10,285
public static Taint merge ( Taint a , Taint b ) { if ( a == null ) { if ( b == null ) { return null ; } else { return new Taint ( b ) ; } } else if ( b == null ) { return new Taint ( a ) ; } assert a != null && b != null ; Taint result = new Taint ( State . merge ( a . getState ( ) , b . getState ( ) ) ) ; if ( a . var...
Returns the merge of the facts such that it can represent any of them
10,286
public void dump ( PrintStream output ) { TreeSet < String > keys = new TreeSet < String > ( keySet ( ) ) ; for ( String key : keys ) { output . println ( key + ":" + get ( key ) ) ; } }
Dumps all the summaries for debugging
10,287
public void load ( InputStream input , final boolean checkRewrite ) throws IOException { new TaintConfigLoader ( ) . load ( input , new TaintConfigLoader . TaintConfigReceiver ( ) { public void receiveTaintConfig ( String typeSignature , String config ) throws IOException { if ( TaintMethodConfig . accepts ( typeSignat...
Loads summaries from stream checking the format
10,288
public void initEntryFact ( TaintFrame fact ) { fact . setValid ( ) ; fact . clearStack ( ) ; boolean inMainMethod = isInMainMethod ( ) ; int numSlots = fact . getNumSlots ( ) ; int numLocals = fact . getNumLocals ( ) ; for ( int i = 0 ; i < numSlots ; ++ i ) { Taint value = new Taint ( Taint . State . UNKNOWN ) ; if (...
Initialize the initial state of a TaintFrame .
10,289
protected Class < ? > resolveClass ( final ObjectStreamClass objectStreamClass ) throws IOException , ClassNotFoundException { try { return Class . forName ( objectStreamClass . getName ( ) , false , classLoader ) ; } catch ( final ClassNotFoundException cnfe ) { return super . resolveClass ( objectStreamClass ) ; } }
Resolve a class specified by the descriptor using the specified ClassLoader or the super ClassLoader .
10,290
protected Class < ? > resolveProxyClass ( final String [ ] interfaces ) throws IOException , ClassNotFoundException { final Class < ? > [ ] interfaceClasses = new Class [ interfaces . length ] ; for ( int i = 0 ; i < interfaces . length ; i ++ ) { interfaceClasses [ i ] = Class . forName ( interfaces [ i ] , false , cl...
Create a proxy class that implements the specified interfaces using the specified ClassLoader or the super ClassLoader .
10,291
private boolean hasCustomReadObject ( Method m , ClassContext classContext , List < String > classesToIgnore ) throws CFGBuilderException , DataflowAnalysisException { ConstantPoolGen cpg = classContext . getConstantPoolGen ( ) ; CFG cfg = classContext . getCFG ( m ) ; int count = 0 ; for ( Iterator < Location > i = cf...
Check if the readObject is doing multiple external call beyond the basic readByte readBoolean etc ..
10,292
public void load ( InputStream input , TaintConfigReceiver receiver ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( input , "UTF-8" ) ) ; for ( ; ; ) { String line = reader . readLine ( ) ; if ( line == null ) { break ; } line = line . trim ( ) ; if ( line . isEmpty ( ) ) { c...
Loads the summaries and do what is specified
10,293
public void addLines ( Collection < TaintLocation > locations ) { Objects . requireNonNull ( detector , "locations" ) ; for ( TaintLocation location : locations ) { lines . add ( SourceLineAnnotation . fromVisitedInstruction ( location . getMethodDescriptor ( ) , location . getPosition ( ) ) ) ; } }
Adds lines with tainted source or path for reporting
10,294
public BugInstance generateBugInstance ( boolean taintedInsideMethod ) { BugInstance bug = new BugInstance ( detector , bugType , originalPriority ) ; bug . addClassAndMethod ( classContext . getJavaClass ( ) , method ) ; bug . addSourceLine ( SourceLineAnnotation . fromVisitedInstruction ( classContext , method , inst...
Uses immutable values updated priority and added lines for reporting
10,295
public void finishAnalysis ( ) { assert analyzedMethodConfig != null ; Taint outputTaint = analyzedMethodConfig . getOutputTaint ( ) ; if ( outputTaint == null ) { return ; } String returnType = getReturnType ( methodDescriptor . getSignature ( ) ) ; if ( taintConfig . isClassTaintSafe ( returnType ) && outputTaint . g...
This method must be called from outside at the end of the method analysis
10,296
private boolean isEmptyImplementation ( MethodGen methodGen ) { boolean invokeInst = false ; boolean loadField = false ; for ( Iterator itIns = methodGen . getInstructionList ( ) . iterator ( ) ; itIns . hasNext ( ) ; ) { Instruction inst = ( ( InstructionHandle ) itIns . next ( ) ) . getInstruction ( ) ; if ( DEBUG ) ...
Currently the detection is pretty weak . It will catch Dummy implementation that have empty method implementation
10,297
public void setOuputTaint ( Taint taint ) { if ( taint == null ) { this . outputTaint = null ; return ; } Taint taintCopy = new Taint ( taint ) ; taintCopy . invalidateVariableIndex ( ) ; this . outputTaint = taintCopy ; }
Sets the output taint of the method describing the taint transfer copy of the parameter is made and variable index is invalidated
10,298
public boolean isInformative ( ) { if ( this == SAFE_CONFIG ) { return false ; } if ( outputTaint == null ) { return false ; } if ( ! outputTaint . isUnknown ( ) ) { return true ; } if ( outputTaint . hasParameters ( ) ) { return true ; } if ( outputTaint . getRealInstanceClass ( ) != null ) { return true ; } if ( outp...
Checks if the summary needs to be saved or has no information value
10,299
public void report ( ) { Set < InjectionSink > injectionSinksToReport = new HashSet < InjectionSink > ( ) ; for ( Set < InjectionSink > injectionSinkSet : injectionSinks . values ( ) ) { for ( InjectionSink injectionSink : injectionSinkSet ) { injectionSinksToReport . add ( injectionSink ) ; } } for ( InjectionSink inj...
Once the analysis is completed all the collected sinks are reported as bugs .