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

Operation canceled when I define an attribute StateAction

Former Member
Former Member
Hi,

When I define the function following in the VaultApplication class, M-Files cancel the state action.
In debug, I don't reach the line of code.
Do you have a sample code to use the attributes please.

    [StateAction("XONYX_QM_ST_APPLICABLE")]
    public void WorkflowStateAction(StateEnvironment env) {
      xQMT.finalDocUpdateVersion(env.Vault, env.ObjVer);
    }

Thanks
Parents
  • Former Member
    Former Member
    Thanks Joonas,

    When I replace the M-Files automatic code on the state script with my code, my code is execute but I have an other problem.
    I had an error System.IO.FileNotFoundException "Impossible to load the file or assembly 'Newtonsoft.Json, Version=10.0.3,...
    My librairies are develop with Json 10.0.3. I have upgraded the nugets Json in version 10.0.3 and when I call my code with VaultApplication, I have the error Json :

    System.IO.FileNotFoundException : 'Impossible de charger le fichier ou l'assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ou une de ses d?pendances. Le fichier sp?cifi? est introuvable.'

    If I call my code with a Visual Project, my code is execute without error (with Json 10.0.3)
    Maybe the problem with the attributes is due to the Json version, can you confirm the VaultApplication V1.0.128 is compatible with Json 10.0.3

    When I go back to the code with attribute SataeAction (with Json 10.0.3), the state action hasn't been registered, the script is empty
    If I go back with Json 6.0.8, the the state action has been registered correctly


Reply
  • Former Member
    Former Member
    Thanks Joonas,

    When I replace the M-Files automatic code on the state script with my code, my code is execute but I have an other problem.
    I had an error System.IO.FileNotFoundException "Impossible to load the file or assembly 'Newtonsoft.Json, Version=10.0.3,...
    My librairies are develop with Json 10.0.3. I have upgraded the nugets Json in version 10.0.3 and when I call my code with VaultApplication, I have the error Json :

    System.IO.FileNotFoundException : 'Impossible de charger le fichier ou l'assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ou une de ses d?pendances. Le fichier sp?cifi? est introuvable.'

    If I call my code with a Visual Project, my code is execute without error (with Json 10.0.3)
    Maybe the problem with the attributes is due to the Json version, can you confirm the VaultApplication V1.0.128 is compatible with Json 10.0.3

    When I go back to the code with attribute SataeAction (with Json 10.0.3), the state action hasn't been registered, the script is empty
    If I go back with Json 6.0.8, the the state action has been registered correctly


Children
No Data