History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-1290
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Robin Shen
Reporter: Maitland Lederer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

API method to see if resource is available.

Created: 13/Jun/12 03:23 PM   Updated: 27/Dec/12 12:45 PM
Component/s: None
Affects Version/s: 4.0.20
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
It would be nice to have script access to the count of a resource that is available, without altering the resource count (aka grabbing the resource).

 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [27/Dec/12 12:45 PM]
This can be done with below script in QB5
groovy:
import com.pmease.quickbuild.*
import com.pmease.quickbuild.entitymanager.*

def resource = ResourceManager.instance.get("name of the resource")
def requests = BuildEngine.instance.getBuildRequests(null)

logger.info("Available resource count: " + (resource.getCount() - resource.getUsedCount(requests))