This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to create an object type (in VB) on workflow state transition

Hello,

I am trying to create an object type when the workflow is in the final stage. The object type is connected over an external source through API.
The idea is to notify some external system through object type creation.

on the workflow transition, I have added the following code in the workflow state PreConditions:


option explicit


Dim publishedReportObjectTypeAdmin
Set publishedReportObjectTypeAdmin = CreateObject("MFilesAPI.ObjTypeAdmin")


Dim publishedReportObjectType
Set publishedReportObjectType = CreateObject("MFilesAPI.ObjType")
publishedReportObjectType.ID = 129
publishedReportObjectType.AllowAdding = true

publishedReportObjectTypeAdmin.ObjectType = publishedReportObjectType
publishedReportObjectTypeAdmin.ConnectionString = "M-Files Extension={5417ed7c-d1a0-43bf-bbae-e84b398e6059};type=publishedreport"

'currently the values are hardcoded here just to test if it is working
publishedReportObjectTypeAdmin.InsertIntoStatement="INSERT INTO  ( DocumentName, DocumentDate, DocumentCreator ) VALUES( 'testDoc', '12-04-2020', 'workflow' )"

Vault.ObjectTypeOperations.AddObjectTypeAdmin(publishedReportObjectTypeAdmin)


I get this error :
Incompatible isolation levels: "65536 -> 1048576".

How can I achieve the creation of object type on state transition ?


Parents
  • Why are you trying to create an object type on a workflow precondition? That sounds wrong. Vault structure is typically static, defined as part of the initial vault configuration. Creating a new object type on demand due to vault interaction sounds like it could cause all sorts of issues in the long term.

    Are you sure that you don't want to create an object, rather than an object type? Can you give some information on what you're trying to achieve?

    Regards,

    Craig.
Reply
  • Why are you trying to create an object type on a workflow precondition? That sounds wrong. Vault structure is typically static, defined as part of the initial vault configuration. Creating a new object type on demand due to vault interaction sounds like it could cause all sorts of issues in the long term.

    Are you sure that you don't want to create an object, rather than an object type? Can you give some information on what you're trying to achieve?

    Regards,

    Craig.
Children
No Data