OnCheckForRequiredECR.LST script file

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Event Scripts > Workflow >

OnCheckForRequiredECR.LST script file

Description

This script allows to incorporate GROUPS/USERS/REVISIONS that could bypass (using filters) the forced existence of an ECR. Useful for most organizations that need to allow the default engineering groups to always be allowed to create new revisions, regardless if an existing ECR already exists.

Activation

Options→Environment→Workflow

Input

@REVISION

the document's revision

@UNIQUE_ID

the document's uniqueId

Output

@OKREQUIREDECR

0: no ECR is required
1 ECR is required

Remarks

Here below is a table that summarizes the effects of different options settings.

Enable ECR workflow

Use OnCheckForRequiredECR.LST

Effect

checkOFF

checkOFF

You can create any revision you like

checkON

checkOFF

You CANNOT create any revision until you complete the creation of a new ECR and the approval of the ECR for the documents

checkON

checkON
@OKREQUIREDECR=0

You can create any revision you like

checkON

checkON
@OKREQUIREDECR=1

You CANNOT create any revision until you complete the creation of a new ECR and the approval of the ECR for the documents

Example

The following example shows how to create a OnCheckForRequiredECR.LST that forces the existance of an ECR for any user not belonging to the DBWorks Designer DBWArm group.

.VBSCRIPT

Sub main()
 DBWInit(True)
 revision = DBWInput("@REVISION")
 uniqueId = DBWInput("@UNIQUE_ID")
 resultTrueFalse = 0
 If DBWGetUserGroup()<>"DBWorks Designer" Then
  resultTrueFalse = 1
 End If
 DBWOutput "@OKREQUIREDECR", resultTrueFalse, ForWriting
End Sub