Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while creating a flow #28

Open
y-aoub opened this issue Aug 26, 2021 · 1 comment
Open

Error while creating a flow #28

y-aoub opened this issue Aug 26, 2021 · 1 comment

Comments

@y-aoub
Copy link

y-aoub commented Aug 26, 2021

I tried to create a new flow and add it to the database, like this. But, I have the error below even if the id and type are defined. Weird!

PET_LC.id = str(uuid.uuid4())
PET_LC.flow_type = olca.FlowType.PRODUCT_FLOW 
PET_LC.name = 'PET_LC'
PET_LC.description = 'PET Bottle Life Cycle'

#items = client.find(olca.FlowProperty, ‘Number of items’) 
items = olca.FlowProperty()
items.name = 'Number of items'

items_factor = olca.FlowPropertyFactor() 
items_factor.conversion_factor = 1.0
items_factor.flow_property = items 
items_factor.reference_flow_property = True
PET_LC.flow_properties = [items_factor]

client.insert(PET_LC)```


`-32602: Invalid params: params must be an object with valid @id and @type`
@msrocka
Copy link
Member

msrocka commented Aug 27, 2021

Seems like the id of the flow property is missing. Also, you need to make sure that the flow property exists in the database before you insert the flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants