Skip to main content

Groovy Script Library

This article gives detailed help on the different groovy scripts available to create system tasks easy.

Updated this week

The Groovy scripts enable users to create system tasks that extend beyond those already provided in the user interface. These tasks can be executed by configuring workflow triggers in both pre-mode and post-mode, as part of a workflow or independently of a workflow. Click the links below to access their detailed help:


A. Groovy Script Library

Below is the predefined syntax structure of the Asite Groovy Script. Add your script code as mentioned below:

def execute(){

------------------------------------------

// Add your script code in this block

------------------------------------------

}

You can access the attributes of document revision via the Groovy script as mentioned below:

No.

Task Mode

Attribute

Purpose

1

Pre / Post

File Name

To access the name of the selected file revision.

2

Pre / Post

Document Ref

To access the document reference for the selected file revision.

3

Pre / Post

Revision

To access the details of the selected file revision.

4

Pre / Post

Document Title

To access the document title of the selected file revision.

5

Pre / Post

Purpose of Issue

To access the purpose of issuing the selected file revision.

6

Pre / Post

Status

To access the status of the selected file revision or app.

7

Pre / Post

Revision Notes

To access the revision notes for the selected file revision.

8

Pre / Post

Has Attachment

To check if the attachment is available with the chosen file revision.

9

Pre / Post

Attached File Name

To access the name of the attached file with the selected file revision.

10

Pre / Post

isPrivate

To check whether the selected file revision is private or not.

11

Post

Document Path

To access the file path of the chosen file revision.

12

Post

File Size

To access the size of the selected file revision.

13

Post

Project Name

To access the name of the project.

14

Post

Publish Date

To access the publication date of the selected file revision.

15

Post

Publisher Email

To access the email address of the user who published the selected file.

16

Post

Publisher Organization

To access the name of the organisation that published the selected file.

17

Post

Version Number

To access the version number of the selected file revision.

18

Post

Configurable Attributes

To access all types of configurable attributes available for the selected file revision.

You can update the value of the attributes of the document revision via a Groovy script as mentioned below:

No.

Task Mode

Attribute

Purpose

1

Post

Document Title

To update the document title of the selected file revision.

2

Post

Revision Number

To update the revision number for the selected file revision.

3

Post

Revision Notes

To revise the notes for the selected file revision.

4

Post

File Status

To change the status of the selected file revision.

5

Post

DocRef

To update the document reference of the selected file revision.

6

Post

Purpose of Issue

To assign a different purpose for issuing the selected file revision.

7

Post

File Privacy

To update the file privacy of the selected file revision.

8

Post

Configurable Attributes

To update all types of configurable attributes available for the selected file revision.

Below is a list of ready-to-use sample Groovy scripts which can be used directly in Groovy script-based system tasks. Click the Groovy script name to go directly to the concerned Groovy script.

No.

Groovy Script Link and Purpose

1

Task Mode: --- | Context: Document --> Document Type: File

2

Task Mode: Pre | Context: Document --> Document Type: File

3

Task Mode: Pre | Context: Document --> Document Type: File

4

Task Mode: Post | Context: Document --> Document Type: File

5

Task Mode: Post | Context: Document --> Document Type: File

6

Task Mode: Post | Context: Document --> Document Type: File

7

Task Mode: Post | Context: Document --> Document Type: File

8

Task Mode: Pre | Context: Document --> Document Type: File

9

Task Mode: Pre | Context: Document --> Document Type: File

10

Task Mode: Pre | Context: Document --> Document Type: File

11

Task Mode: Pre | Context: Document --> Document Type: File

12

Task Mode: Pre / On-Load | Context: Document --> Document Type: File

13

Task Mode: Pre | Context: Document --> Document Type: File

14

Task Mode: Post | Context: Document --> Document Type: File

15

Task Mode: Post | Context: Document --> Document Type: File

16

Task Mode: Post | Context: Document --> Document Type: File

17

Task Mode: Post | Context: Document --> Document Type: File

18

Task Mode: Post | Context: Document --> Document Type: File

19

Task Mode: Post | Context: Document --> Document Type: File

20

Task Mode: Post | Context: Document --> Document Type: File

21

Task Mode: Post | Context: Document --> Document Type: File

22

Task Mode: Post | Context: Document --> Document Type: File

23

Task Mode: Pre | Context: Document --> Document Type: File

24

Task Mode: Post | Context: App

25

Task Mode: Post | Context: Document --> Document Type: File

26

Task Mode: Post | Context: Document --> Document Type: File

27

Task Mode: Post | Context: Document --> Document Type: File

28

Task Mode: Post | Context: Document --> Document Type: File

29

Task Mode: Post | Context: Document --> Document Type: File

30

Task Mode: On-Load | Context: Document --> Document Type: File

31

Task Mode: Pre | Context: Document --> Document Type: File

32

Task Mode: On-Load | Context: Document --> Document Type: File

33

Task Mode: On-Load | Context: Document --> Document Type: File

34

Task Mode: Post | Context: Document --> Document Type: File

35

Task Mode: Post | Context: App

36

Task Mode: Post | Context: App

37

Task Mode: Pre | Context: Document --> Document Type: File

38

Task Mode: Pre | Context: Document --> Document Type: File

39

Task Mode: On-Load | Context: Document --> Document Type: File

40

Task Mode: On-Load | Context: Document --> Document Type: File

41

Task Mode: Post | Context: App

42

Task Mode: On-Load | Context: Document --> Document Type: File

43

Task Mode: Post | Context: Document --> Document Type: File

44

Task Mode: Post | Context: Document --> Document Type: File

45

Task Mode: On-Load | Context: Document --> Document Type: File

46

Task Mode: Post | Context: App

47

Task Mode: Post | Context: Any

48

Task Mode: On-Load | Context: Document --> Document Type: File

49

Task Mode: Pre | Context: Document --> Document Type: File

50

Task Mode: Post | Context: Document --> Document Type: File

51

Task Mode: Post | Context: App

52

Task Mode: Pre | Context: Document --> Document Type: File

53

Task Mode: Post | Context: Document --> Document Type: File

54

Task Mode: Post | Context: App

55

Task Mode: Post | Context: App

56

Task Mode: Post | Context: Document --> Document Type: File

57

Task Mode: Post | Context: Document --> Document Type: File

58

Task Mode: Post | Context: App

59

Task Mode: On-Load | Context: Document --> Document Type: File

60

Task Mode: Post | Context: App

61

Task Mode: Post | Context: Document --> Document Type: File

62

Task Mode: Post | Context: Document --> Document Type: File

63

Task Mode: Post | Context: App

64

Task Mode: Post | Context: App

65

Task Mode: Post | Context: Document --> Document Type: File

66

Task Mode: Post | Context: Document --> Document Type: File

67

Task Mode: Post | Context: App

68

Task Mode: Pre | Context: Document --> Document Type: File

69

Task Mode: Post | Context: App

70

Task Mode: On-Load | Context: Document --> Document Type: Placeholder

71

Task Mode: On-Load | Context: Document --> Document Type: Placeholder

72

Task Mode: Post | Context: Document --> Document Type: Placeholder

73

Task Mode: Post | Context: Document --> Document Type: Placeholder

74

Task Mode: Post | Context: Document --> Document Type: File

75

Task Mode: Post | Context: Document --> Document Type: Placeholder

76

Task Mode: Post | Context: Document --> Document Type: Placeholder

77

Task Mode: Pre | Context: Document --> Document Type: File/Placeholder


Check: FAQs


Did this answer your question?