Hide Table of Contents
ChangeState2 Method (IEdmFile10)

Obsolete. Superseded by IEdmFile13::ChangeState3.

Syntax

Visual Basic (Declaration) 
Sub ChangeState2( _
   ByRef poStateIdOrName As System.Object, _
   ByVal lFolderID As System.Integer, _
   ByVal bsComment As System.String, _
   ByVal lParentWnd As System.Integer, _
   Optional ByVal lEdmStateFlags As System.Integer, _
   Optional ByVal bsPasswd As System.String _
) 
C# 
void ChangeState2( 
   ref System.object poStateIdOrName,
   System.int lFolderID,
   System.string bsComment,
   System.int lParentWnd,
   System.int lEdmStateFlags,
   System.string bsPasswd
)
C++/CLI 
void ChangeState2( 
&   System.Object^% poStateIdOrName,
&   System.int lFolderID,
&   System.String^ bsComment,
&   System.int lParentWnd,
&   System.int lEdmStateFlags,
&   System.String^ bsPasswd
) 

Parameters

poStateIdOrName

Workflow state ID or name or IEdmState5 to which this file transitions (see Remarks)

lFolderID
ID of the file's active parent folder
bsComment
Comment saved to the transition history
lParentWnd
Parent window handle
lEdmStateFlags
Optional combination of EdmStateFlags bits; default is EdmStateFlags.EdmState_Simple
bsPasswd

Optional password of user executing the transition

Remarks

The difference between this method and the now obsolete IEdmFile5::ChangeState is that this method requires a user password.

There must be a transition between the current state and poStateIdOrName, or this method fails.

It is possible to create multiple workflows with two or more states having the same name. If poStateIdOrName contains the name of the destination state instead of its ID, and if several transitions from the file’s current state lead to new states all having the same name, SOLIDWORKS PDM Professional randomly selects one of them. To be sure to which state the file transitions, specify a state ID in poStateIdOrName.

Return codes:

  • S_OK: The method successfully executed.
  • E_EDM_STATECHANGE_FAILED: The password is invalid.
  • E_EDM_TRANSITION_ACTION_FAILED: One of the transition actions set up in the workflow failed.
  • E_EDM_OPERATION_REFUSED_BY_PLUGIN: One of the EdmCmdType.EdmCmd_PreState hooks did not permit the operation.
  • E_EDM_FILE_IS_LOCKED: The file is checked out. Changing state is only permitted on checked-in files.
  • E_EDM_PERMISSION_DENIED: The logged-in user lacks permission to change state.
  • E_EDM_CONDITIONS_NOT_MET: The conditions set up in the Workflow Editor for this transition were not met.
  • E_EDM_STATE_NOT_FOUND: There is no transition going from the file's current state to the specified state.
 

See Also

Availability

SOLIDWORKS PDM Professional 2015 SP02


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   ChangeState2 Method (IEdmFile10)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2018 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.