MIM Functions(4.1)

The MIM functions allows the agent to publish its own MIM values or to read MIM values from other agents.

Note!

The MIM functions cannot be used within global APL scripts, that is in code saved in the APL Code Editor.

mimGet

Returns the value of a MIM resource available in the workflow.

any mimGet
 ( string  category , 
 string  mimResourceName  );
ParameterDescription

category

Name of the agent or workflow owning the MIM resource

mimResourceName

Name of the MIM resource whose value is to be returned

Returns

MIM value as any type. The result always needs to be type casted or else compilation fails

Example - Using mimGet

mimGet("Workflow", "Batch Count"); // Retrieving a MIM resource owned by the workflow.
mimGet("Disk_1", "Source File Count"); // Retrieving a MIM resource owned by the agent "Disk_1".

mimIsNull

Evaluates if a MIM resource is defined. Available to evaluate MIMs of non-object types, such as int.

boolean mimIsNull
 ( string  category , 
 string  mimResourceName );
ParameterDescription

category

Name of the agent or workflow owning the MIM resource.

mimResourceName

Name of the MIM resource to look for.

Returns

true or false.

mimPublish

Publishes a MIM resource. The method call can only be used outside a function block.

void mimPublish
 (  assigned , 
 string  name ,
  mimType );
ParameterDescription

assigned

Keyword that identifies when the MIM resource is assigned a value. Can be one of:

  • batch - Value is assigned from the consume block.

  • header - Value is assigned in the beginBatch block.

  • trailer - Value is assigned in the endBatch block.

  • global - Value is assigned from any block.

name

MIM resource name. Must be a string constant.

mimType

Data type of MIM resource

Returns

Nothing

Note!

Real-time workflows can only publish MIMs of type global.

mimSet

Assigns a value to a user defined MIM resource. The function may be called at any time. Note that it is the responsibility of the user to make sure the MIM value is available in accordance with the specified assigned type (refer to the section above, mimPublish).

void mimSet
 ( string  name , 
 any  value );
ParameterDescription

name

Name of the MIM resource to assign a value

value

Value to assign - must match the published MIM type

Returns

Nothing

MIM Example

Example - MIM

Note that mimSet is made from a drain block. This to make sure the MIM exists when called from any other agent. The calls will be made at endBatch (for trailer MIMs), which always occurs after drain.

mimPublish(trailer, "Total duration", int);
int duration;

beginBatch {
 duration = 0;
}

consume {
 duration = duration + input.CallDuration;
}

drain {
 mimSet( "Total duration", duration );
}