system.recipe.getRecipeValueSecurity

Sepasoft MES Module Suite

Description

Returns a Machine Recipe Value Security Info object that contains each security roles settings. Retrieve a role by using the getSecurityRole method of the object.

Syntax

system.recipe.getRecipeValueSecurity(itemPath, valueName, inherited)

 

  • Parameters

String itemPath - The item path to a production line, cell, cell group or location.

String valueName - The recipe value name to get the security settings for.

Boolean inherited - Set to 0 to get the value settings. If set to 1, it will return the inherited settings.

  • Returns

A Machine Recipe Value Security Info object.

  • Scope

All

Code Examples

Code Snippet

Code
# Get a recipe value security and display it

recipeName = "B_Test" #'PC_007-IBC-RB'
itemPath = 'Enterprise\New Site\Packaging\packagingLine1\Filler'
userRole = 'Operators'
secdata = ""
result = ""

# first, get the list of all recipe value names and cycle through the list
list = system.recipe.getRecipeValues(itemPath, recipeName,"")
if list.size() > 0:
    for rv in list:
        # get the security object (RecipeValueSecurityInfo) for the recipe value name
        recipeValueSecurityInfo = system.recipe.getRecipeValueSecurity(itemPath, rv.getName(),0)
        # get the RecipeValueSecurityRole object for a user role from the security object
        recipeValueSecurityRole = recipeValueSecurityInfo.getSecurityRoll(userRole)
        if recipeValueSecurityRole != None:        
            secdata =  "%s 
 %s: userRole=%s min val=%s, max val=%s" % (secdata,rv.getName(), userRole, str(recipeValueSecurityRole.getMinValue()), str(recipeValueSecurityRole.getMaxValue()) )
    result = "%s

Security values: %s" %(result, secdata)
    print result
else:
    print 'No production items found for %s' %itemPathFilter

Output

Code
Security values:  
 IBC Vanilla Percentage: userRole=Operators min val=-1.7976931348623157E308, max val=1.7976931348623157E308 
 Max Temperature: userRole=Operators min val=-2.147483648E9, max val=2.147483647E9 
 Min Temperature: userRole=Operators min val=-1.7976931348623157E308, max val=1.7976931348623157E308 
 IBC Sugar Percentage: userRole=Operators min val=-1.7976931348623157E308, max val=1.7976931348623157E308 
 Line Speed: userRole=Operators min val=-2.147483648E9, max val=2.147483647E9

 

 

Sepasoft MES Module Suite