Human Activity Methods

You can use the methods listed below to define the attributes of human activities.

Note: The types of human activities that you can define using these methods depend on your role or roles (ecoinvent, custom, and integrated human activities).

This page discusses:

Define the Diversity Attributes of Human Activities

You can use the HumanActivityAssignment.AddDiversity() method to add diversity attributes to a human activity. Geolocation is an example of a diversity axis.

This method is only available on premises, and is not available on the cloud.

Signature

HumanActivityAssignment.AddDiversity(iDiversityAxis : String, iValue : String)

Arguments

Name Input/Output Required? Type Comment
iDiversityAxis In String Name of the diversity axis
iValue In String Value of the diversity for a given axis

Example

CastCarbonSteelHSHBeta_2.AddDiversity("configuration", "Airbus380")

Define the Geolocation of Human Activities

You can use the HumanActivityAssignment.AddGeolocation() method to specify the geolocation of a human activity.

Signature

HumanActivityAssignment.AddGeolocation(iGeolocation : Enumere [, iOverloadedGeolocation : Enumere])

Arguments

Name Input/Output Required? Type Comment
iGeolocation In Enumere Name of the geolocation
iOverloadedGeolocation In Enumere Name of the overloaded geolocation

Example

let Geolocation(HumanActivityGeolocation)
let OverloadedGeolocation(HumanActivityGeolocation)
Geolocation="GLO"//Worldwide
OverloadedGeolocation="AM"//Morocco

CastCarbonSteelHSHBeta_2.AddGeolocation(Geolocation, OverloadedGeolocation)

Define the Characteristic Values of Human Activities

You can use the HumanActivityCharacteristicValue.SetCharacteristicValues() method to specify the characteristic values of a human activity.

This method lets you overload the characteristic values.

Signature

HumanActivityCharacteristicValue.SetCharacteristicValues(iName : String, iValue : String)

Arguments

Name Input/Output Required? Type Comment
iName In String Name of the characteristic
iValue In String Value of the characteristic

Example

haCharacteristicValue. SetCharacteristicValues("SULFURDIOXIDE", “2unit” )

Add Assignment Objects for Human Activities

You can use the HumanActivityManager.AddAssignment() method to create an assignment object for a human activity based on the HumanActivityAssignment type. For more information, see Assign Human Activities.

Signature

HumanActivityManager.AddAssignment(HumanActivityAssignment)

Arguments

Name Input/Output Required? Type Comment
iHAAssignObject In HumanActivityAssignment Name of the human activity assignment object to add

Example

HAManager.AddAssignment(CastCarbonSteelHSHBeta_2)
HAManager.AddAssignment(AnotherHAAssignmentObject)
HAManager.CommitAssignments()

Send Human Activity Assignment Objects to the Server

You can use the HumanActivityManager.CommitAssignments() method to send human activity assignment objects to the server, process the response from the server, and manage assignment errors.

Signature

HumanActivityManager.CommitAssignments()

Example

HAManager.AddAssignment(CastCarbonSteelHSHBeta_2)
HAManager.AddAssignment(AnotherHAAssignmentObject)
HAManager.CommitAssignments()

Retrieve the Status List of Human Activity-Related Actions

You can use the HAReport.GetListOfStatus() method to obtain the list of statuses (HAStatus type) for the different human activity-related actions (attached from objects or IDs or detached). The statuses are available in the human activity report (HAReport type).

Signature

HAReport.GetListOfStatus() : List

ReturnType

List

Example

let HAManager(HumanActivityManager)
HAManager = CreateHumanActivityManager();
let ListOfHAInst(HumanActivityInst)
let MyReport(HAReport)
HAManager.Detach(ListOfHAInst,MyReport)
let MyListStatus(List)
MyListStatus  = MyReport->GetListOfStatus()
With the MyGetReport type being HAReport:

let MyListStatus(List)
MyListStatus = MyGetReport.GetListOfStatus()

Retrieve the List of Failed Human Activity-Related Actions

You can use the HAReport.GetListOfFailedStatus() method to obtain the list of failed statuses (HAStatus type) for the different human activity-related actions (attached from objects or IDs or detached). The statuses are available in the human activity report (HAReport type).

For more information, see the HAStatus and HAReport types.

Signature

HAReport.GetListOfFailedStatus() : List

ReturnType

List

Retrieve Assigned Human Activities from Physical Object IDs

You can use the HumanActivityManager.GetAttachedHAsFromIDs() method to generate a report that lists all the attached human activities, based on a list of IDs of physical objects (VPMReference).

Notes:
  • This method only lists human activities created in shared collaborative spaces.
  • Wait for your data to be indexed before using this method.

Signature

HumanActivityManager.GetAttachedHAsFromIDs(ListOfIDs : List, MapHAInst : Map, Report : HAReport) : Integer

Arguments

Name Input/Output Required? Type Comment
ListOfIDs In List List of physical object IDs used to retrieve the list of assigned human activities
MapHAInst Out Map Map including:
  • The key string from the ListOfIDs attribute
  • A value list of the attached human activities (available using the HumanActivityInst method)
Report Out HAReport Report including the list of human activities assigned to objects

ReturnType

Integer
The method returns one of the following values:
  • 0: the method succeeded
  • -1: the method failed
  • integer > 0: the method was not used yet

If the method cannot find the entity, the following error appears: EKL_Error_GetId_01 - Entity not found

Example

let HAManager(HumanActivityManager)
HAManager = CreateHumanActivityManager();
let mapHAInst (Map)
mapHAInst = CreateMap(“String”,”Feature”)
let MyGetReport(HAReport)
let ListOfProductsIDs (List)
HAManager.GetAttachedHAsFromIDs (ListOfProductsIDs, mapHAInst, MyGetReport)
let ListOfHAInst(HumanActivityInst)
ListOfHAInst  = mapHAInst.Get(ListOfProductsIDs.GetItems(1))

Retrieve Assigned Human Activities from Objects

You can use the HumanActivityManager.GetAttachedHAsFromObjects() method to generate a report that lists all the attached human activities, based on a list of objects (VPMReference) without IDs.

Notes:
  • This method only lists human activities created in shared collaborative spaces.
  • Wait for your data to be indexed before using this method.

Signature

HumanActivityManager.GetAttachedHAsFromObjects(ListOfObjects : List, MapHAInst : Map, Report : HAReport) : Integer

Arguments

Name Input/Output Required? Type Comment
ListOfObjects In List List of object IDs used to retrieve the list of assigned human activities
MapHAInst Out Map Map including:
  • The key objects from the ListOfIDs attribute
  • A value list of the attached human activities (available using the HumanActivityInst method)
Report Out HAReport Report including the list of human activities assigned to objects

ReturnType

Integer
The method returns one of the following values:
  • 0: the method succeeded
  • -1: the method failed
  • integer > 0: the method was not used yet

If the method cannot find the entity, the following error appears: EKL_Error_GetObject_01 - Entity not found

Example

Example 1:
let HAManager(HumanActivityManager)
HAManager = CreateHumanActivityManager();
let mapHAInst (Map)
mapHAInst = CreateMap(“Feature”,”Feature”)
let MyGetReport(HAReport)
let ListOfProducts(List)
HAManager.GetAttachedHAsFromObjects(ListOfProducts, mapHAInst, MyGetReport)
let ListOfHAInst(HumanActivityInst)
ListOfHAInst  = mapHAInst.Get(ListOfProducts.GetItems(1))
Example 2:
 
let HAMgr(HumanActivityManager)
HAMgr =CreateHumanActivityManager()
let listObj(List)
listObj.Append(P)
let mapHAInst (Map)
mapHAInst = CreateMap("Feature","Feature")
let MyGetReport(HAReport)
let statusGet(Integer)
Trace(2,"--------------------------------------")
Trace(2,"GetAttachedHAsFromObjects")
Trace(2,"--------------------------------------")
HAMgr.GetAttachedHAsFromObjects(listObj,mapHAInst,MyGetReport)
Trace(2,"--------------------------------------")
Trace(2,"Global Status : ",MyGetReport.Status)
Trace(2,"Global Messsage: ",MyGetReport.Message)
let MyListStatus(List)
MyListStatus = MyGetReport.GetListOfStatus()
let Mystatus(HAStatus)
for Mystatus inside MyListStatus
{
 Trace(2,"       --------------------------------------")
 Trace(2,"          Status : ",Mystatus.Status)
 Trace(2,"          Messsage: ",Mystatus.Message)
 Trace(2,"          ObjectID: ",Mystatus.ObjectID)
 Trace(2,"          ObjectName: ",Mystatus.ObjectName)	
 Trace(2,"       --------------------------------------")
}
Trace(2,"--------------------------------------")
let ObjectMapList(List)
ObjectMapList = mapHAInst->Get(P)
let HAInst(HumanActivityInst)
let lifeCycleList(List)
let overloadedLifeCycleList(List)
let HALifeCycle(HumanActivityLifeCyclePhases)
let characteristic(HumanActivityCharacteristic)
let characteristicList(List)
let objectHAAttached(VPMReference)
for HAInst inside ObjectMapList
{
  lifeCycleList->RemoveAll()
  overloadedLifeCycleList->RemoveAll()
  Trace(2,"       --------------------------------------")
  Trace(2,"           HAInst ")
  lifeCycleList = HAInst.LifeCyclePhases
  Trace(2,"           Number Of lifeCycle  : ",lifeCycleList.Size())
  for HALifeCycle inside lifeCycleList
	{
	  Trace(2,"             lifeCycle ",HALifeCycle)
	}
  overloadedLifeCycleList = HAInst.OverloadedLifeCyclePhases
  Trace(2,"           Number Of overloaded lifeCycle  : ",overloadedLifeCycleList.Size())
  for HALifeCycle inside overloadedLifeCycleList
	{
	  Trace(2,"             lifeCycle ",HALifeCycle)
	}
  Trace(2,"           Origin : ",HAInst.Origin)
  characteristicList = HAInst.OverloadedCharacteristics
  for characteristic inside characteristicList
	{
        Trace(2,"       Characteristic")
	  Trace(2,"                    Characteristic Name : ",characteristic.Name)
	  Trace(2,"                    Characteristic Overload : ",characteristic.Overload )
	  Trace(2,"                    Characteristic OverloadedValue : ",characteristic.OverloadedValue)
	  Trace(2,"                    Characteristic Unit : ",characteristic.Unit)
	}
  Trace(2,"           Geolocation Ref: ",HAInst.Geolocation)
  Trace(2,"           Overloaded Geolocation : ",HAInst.OverloadedGeolocation)
  objectHAAttached = HAInst.ToObject
  Trace(2,"           Object : ",objectHAAttached.Name)	
}

Detach Human Activities

You can use the HumanActivityManager.Detach() method to detach a list of human activities from objects.

Notes:
  • This method only detaches the human activities created in shared collaborative spaces.
  • Wait for your data to be indexed before using this method.

Signature

HumanActivityManager.Detach(ListOfHAIns : List, Report : HAReport) : Integer

Arguments

Name Input/Output Required? Type Comment
ListOfHAIns In List List of human activities to detach
Report Out HAReport Report including the list of detached human activities

ReturnType

Integer
The method returns one of the following values:
  • 0: the method succeeded
  • -1: the method failed
  • integer > 0: the method was not used yet

If the method cannot find a human activity, the following error appears: EKL_Error_Detach_01 - Human Activity Instance not found, check it.

Example

let HAManager(HumanActivityManager)
HAManager = CreateHumanActivityManager();
let ListOfHAInst(HumanActivityInst)
let MyGetReport(HAReport)
HAManager.Detach(ListOfHAInst,MyGetReport