PLMResourceTypePackage Methods

This page discusses:

ResourceOccurrence.AssignOperation()

Assigns an operation to the resource occurrence.

Signature

ResourceOccurrence.AssignOperation(Production System Occurrence : ProdSystemOccurrence)

Arguments

Name Input / Output Required? Type Comment
Production System Occurrence In ProdSystemOccurrence Operation to assign as ProdSystemOccurrence.

Example

let MyOcc(ResourceOccurrence)
let MyProdSysOcc(ProdSystemOccurrence)
MyOcc.AssignOperation(MyProdSysOcc)

ResourceOccurrence.AssignOperationWithDetailingTask()

Assigns an operation occurrence to a resource occurrence, by specifying the detailing task.

If the operation occurrence is already assigned to the resource occurrence, the detailing task only is updated on the existing implement link.

Signature

ResourceOccurrence.AssignOperationWithDetailingTask(OperationOccurrence, Task : Integer)

Arguments

Name Input / Output Required? Type Comment
ResourceOccurrence In ResourceOccurrence Resource occurrence
OperationOccurrence In ProdSystemOccurrence Operation occurrence to assign
Task In DNBResourceTask Task to specify

ReturnType

0: Success: the operation was already assigned to the resource and the task has been correctly specified.

1: Success: the operation was sucessfully assigned to the resource and the task has been correctly specified.

2: Success: the task has replaced an already specified task.

3: Success: the operation and task were already assigned to the resource.

4: Failure: the task is not assignable for OperationOccurrence.

5: Failure: the task does not correspond to a resource accessible task.

6: Failure: the operation was not assigned and the attempt to assign has failed (check if a resource process scope exists).

7: Failure: the task is already specified for a resource on another operation.

8: Failure: OperationOccurrence is not an operation (it might be a system/workplan).

9: Failure: other error.

Example

Let MyTaskMgr(DNBTaskManager)
Let MyListTask(List)

Let MyResourceOcc(ResourceOccurrence)
Let MyTask(DNBResourceTask)
Let MyOpOcc(ProdSystemOccurrence)
Let RetCode (Integer)

Set MyResourceOcc = Resource1//[Resource1 from Argument List, Provided by User Selection]
MyTaskMgr = GetTaskManager(MyResourceOcc)
MyTaskMgr.GetTaskList(MyListTask) // Assuming MyResourceOcc has one or more tasks
Set MyTask   = MyListTask.GetItem(1) // Assuming MyResourceOcc has one or more tasks
Set MyOpOcc = Op1 //[Operation from Argument List, Provided by User Selection]
Set RetCode = MyResourceOcc.AssignOperationWithDetailingTask(MyOpOcc, MyTask )

ResourceOccurrence.CreateScope()

Defines a scope link between a system and the resource occurrence.

Signature

ResourceOccurrence.CreateScope(Production System Occurrence : ProdSystemOccurrence)

Arguments

Name Input / Output Required? Type Comment
Production System Occurrence In ProdSystemOccurrence System reference as ProdSystemOccurrence.

Example

Let MyProdSysOcc(ProdSystemOccurrence)
Let MyResourceOcc(ResourceOccurrence)
set MyProdSysOcc = Occ1//[Occ1 From Argument List,provided by user selection]
set MyResourceOcc = Occ2//[Occ2 From Argument List,provided by user selection]
MyResourceOcc->CreateScope(MyProdSysOcc)

ResourceOccurrence.GetAssignedOperationsWithDetailingTasks()

Gets the list of assigned operations, along with the specified detailing tasks.

If the operation has no specified detailing task, the operation is repeated in output tasks. In this case, negociation as a DNBResourceTask gives NULL.

Signature

ResourceOccurrence.GetAssignedOperationsWithDetailingTasks(OperationsList, TaskList : Integer)

Arguments

Name Input / Output Required? Type Comment
ResourceOccurrence In ResourceOccurrence Resource occurrence implementing the operations
OperationsList Out List List of assigned operations
TaskList Out List List of corresponding specified tasks/operations if there is no detail

ReturnType

0: Success.

1: Failure.

Example

Let MyResourceOcc(ResourceOccurrence)

Let TasksList (List)
Let OperationsList (List)
Let index (Integer)
Let Operation_i(ProdSystemOccurrence)
Let Task_i(DNBResourceTask)

Let RetCode (Integer)
Set MyResourceOcc = Resource1//[Resource1 from Argument List, Provided by User Selection]
Set RetCode = MyResourceOcc.GetAssignedOperationsWithDetailingTasks(OperationsList,TasksList)
Set index=1
for index while index <= OperationsList.Size()
{
	Operation_i = OperationsList.GetItem(index)
	Task_i = TasksList.GetItem(index)
	If(Task_i <>NULL)
	{
		// A Detail is specified on Operation
	}
	}

ResourceOccurrence.GetChildren()

Returns the child resources of the resource occurrence.

Signature

ResourceOccurrence.GetChildren() : List

ReturnType

List

Child resources as list of ResourceOccurrence.

Example

let MyResourceOcc(ResourceOccurrence)
let MyList(list)
set MyResourceOcc = Occ1//[Occ1 From Argument List,provided by user selection]
MyList = MyResourceOcc.GetChildren()

ResourceOccurrence.GetFather()

Returns the father resource of the resource occurrence.

Signature

ResourceOccurrence.GetFather() : ResourceOccurrence

ReturnType

ResourceOccurrence

Father resource as ResourceOccurrence.

Example

Let MyResourceOcc(ResourceOccurrence)
set MyResourceOcc = Occ1//[Occ1 From Argument List,provided by user selection]
MyResourceOcc = MyResourceOcc->GetFather()

ResourceOccurrence.RemoveDetailingTask()

Removes the detailing task specified on the implement link between a resource occurrence and an operation occurrence.

Signature

ResourceOccurrence.RemoveDetailingTask( OperationOccurrence ): Integer

Arguments

Name Input / Output Required? Type Comment
ResourceOccurrence In ResourceOccurrence Resource occurrence implementing the operation
OperationOccurrence In ProdSystemOccurrence Implemented operation occurrence

ReturnType

0: Success: the task is removed form the implement link, the operation is still assigned to the resource.

1: Success: no resource task is specified on the implement link between this resource occurrence and this operation occurrence.

0: Success: other error.

Example

Let MyResourceOcc(ResourceOccurrence)
Let MyProdSysOcc(ProdSystemOccurrence)
Let RetCode (Integer)
Set MyResourceOcc = Resource1//[Resource1 from Argument List, Provided by User Selection]
Set MyProdSysOcc = Op1 //[Operation from Argument List, Provided by User Selection]
Set RetCode = MyResourceOcc.RemoveDetailingTask(MyProdSysOcc)

ResourceOccurrence.RemoveScope()

Removes the scope link between the input system reference and the resource occurrence.

Signature

ResourceOccurrence.RemoveScope( Production system )

Arguments

Name Input / Output Required? Type Comment
Production system In ProdSystemOccurrence None.

Example

let MyPrdSysOcc(ProdSystemOccurrence)
let MyResourceOcc(ResourceOccurrence)
set MyPrdSysOcc = Occ1//[Occ1 from Argument List ,given by user selection]
set MyResourceOcc = Occ2//[Occ2 from Argument List ,given by user selection]
MyResourceOcc.RemoveScope(MyPrdSysOcc)

ResourceOccurrence.UnassignOperation()

Unassigns the operation from the resource occurrence.

Signature

ResourceOccurrence.UnassignOperation(Operation)

Arguments

Name Input / Output Required? Type Comment
Operation In ProdSystemOccurrence None.

Example

let MyOcc(ResourceOccurrence)
let MyProdSysOcc(ProdSystemOccurrence)
MyOcc.UnAssignOperation(MyProdSysOcc)

SetSerialNumberAttribute

Sets the serial number on the asset (resource reference).

Signature

PLMResource.SetSerialNumberAttribute(Serial_Number)

Arguments

Name Input / Output Required? Type Comment
Serial_Number Input String Serial number to store on the asset

Example

let MyResourceRef(PLMResource)
let MySerialNumber(String)
MySerialNumber = “SN-12345”
MyResourceRef.SetSerialNumberAttribute(MySerialNumber)