├── .gitignore
├── AUTHORS
├── LICENSE.md
├── MoquiConf.xml
├── README.md
├── build.gradle
├── component.xml
├── data
├── BasicData.xml
├── ComponentEmailData.xml
├── ComponentMessageDataEn.xml
├── ComponentSecurityData.xml
├── ComponentServiceJobData.xml
├── EntityData.xml
├── SecurityData.xml
├── WorkflowData.xml
└── WorkflowDemoData.xml
├── entity
├── EntityEntities.xml
├── EntityViewEntities.xml
├── WorkflowEntities.xml
└── WorkflowViewEntities.xml
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── myaddons.xml
├── screen
├── Workflow.xml
└── Workflow
│ ├── WorkflowInstance.xml
│ └── WorkflowInstance
│ ├── EditWorkflowInstance.xml
│ ├── FindWorkflowInstance.xml
│ ├── FindWorkflowInstanceEvent.xml
│ └── FindWorkflowInstanceVariable.xml
├── service
├── org
│ └── moqui
│ │ ├── basic
│ │ └── BasicServices.xml
│ │ ├── entity
│ │ └── EntityFieldServices.xml
│ │ ├── security
│ │ └── SecurityServices.xml
│ │ └── workflow
│ │ └── WorkflowServices.xml
├── workflow.rest.xml
└── workflow.secas.xml
├── settings.gradle
└── src
└── main
└── java
└── org
└── moqui
├── basic
├── StatusFlowService.java
└── StatusItemService.java
├── entity
├── EntityFieldService.java
└── util
│ ├── EntityConditionBuilder.java
│ └── EntityFieldType.java
├── security
├── UserGroupService.java
└── UserService.java
├── util
├── BooleanComparisonOperator.java
├── ContextUtil.java
├── DateComparisonOperator.java
├── EntityFieldType.java
├── JsonUtil.java
├── NumberComparisonOperator.java
├── ServerUtil.java
├── StringUtil.java
├── TextComparisonOperator.java
├── TimeFrequency.java
└── TimestampUtil.java
└── workflow
├── WorkflowService.java
├── WorkflowTypeService.java
├── activity
├── AbstractWorkflowActivity.java
├── WorkflowActivity.java
├── WorkflowAdjustmentActivity.java
├── WorkflowConditionActivity.java
├── WorkflowEnterActivity.java
├── WorkflowExitActivity.java
├── WorkflowNotificationActivity.java
├── WorkflowServiceActivity.java
└── WorkflowUserActivity.java
├── condition
├── BooleanCondition.java
├── DateCondition.java
├── NumberCondition.java
├── ScriptCondition.java
├── TextCondition.java
└── WorkflowCondition.java
└── util
├── WorkflowActivityType.java
├── WorkflowAdjustmentType.java
├── WorkflowConditionType.java
├── WorkflowCrowdType.java
├── WorkflowEventType.java
├── WorkflowInstanceStatus.java
├── WorkflowLaunchType.java
├── WorkflowNotificationType.java
├── WorkflowPortType.java
├── WorkflowTaskStatus.java
├── WorkflowTaskType.java
├── WorkflowUtil.java
└── WorkflowVariableType.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # gradle/build files
2 | build/
3 | .gradle
4 |
5 | # runtime added files
6 | lib/
7 |
8 | # IntelliJ IDEA files
9 | .idea/
10 | out/
11 | *.ipr
12 | *.iws
13 | *.iml
14 |
15 | # Eclipse files (and some general ones also used by Eclipse)
16 | .metadata
17 | .gradle
18 | bin/
19 | tmp/
20 | *.tmp
21 | *.bak
22 | *.swp
23 | *~.nib
24 | local.properties
25 | .settings/
26 | .loadpath
27 |
28 | # NetBeans files
29 | nbproject/private/
30 | nbbuild/
31 | .nb-gradle/
32 | # allow dist, some JS libs in webroot/assets use it: dist/
33 | nbdist/
34 | nbactions.xml
35 | nb-configuration.xml
36 |
37 | # OSX auto files
38 | .DS_Store
39 | .AppleDouble
40 | .LSOverride
41 | ._*
42 |
43 | # Windows auto files
44 | Thumbs.db
45 | ehthumbs.db
46 | Desktop.ini
47 |
48 | # Linux auto files
49 | *~
50 |
51 |
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | Moqui Workflow Engine (https://github.com/Netvariant/moqui-workflow)
2 |
3 | This software is in the public domain under CC0 1.0 Universal plus a
4 | Grant of Patent License.
5 |
6 | To the extent possible under law, the author(s) have dedicated all
7 | copyright and related and neighboring rights to this software to the
8 | public domain worldwide. This software is distributed without any
9 | warranty.
10 |
11 | You should have received a copy of the CC0 Public Domain Dedication
12 | along with this software (see the LICENSE.md file). If not, see
13 | .
14 |
15 | ===========================================================================
16 |
17 | Copyright Waiver
18 |
19 | I dedicate any and all copyright interest in this software to the
20 | public domain. I make this dedication for the benefit of the public at
21 | large and to the detriment of my heirs and successors. I intend this
22 | dedication to be an overt act of relinquishment in perpetuity of all
23 | present and future rights to this software under copyright law.
24 |
25 | To the best of my knowledge and belief, my contributions are either
26 | originally authored by me or are derived from prior works which I have
27 | verified are also in the public domain and are not subject to claims
28 | of copyright by other parties.
29 |
30 | To the best of my knowledge and belief, no individual, business,
31 | organization, government, or other entity has any copyright interest
32 | in my contributions, and I affirm that I will not make contributions
33 | that are otherwise encumbered.
34 |
35 | Signed by git commit adding my legal name and git username:
36 |
37 | Written in 2019 by Ayman Abi Abdallah - aabiabdallah
38 |
39 | ===========================================================================
40 |
41 | Grant of Patent License
42 |
43 | I hereby grant to recipients of software a perpetual, worldwide,
44 | non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
45 | this section) patent license to make, have made, use, offer to sell, sell,
46 | import, and otherwise transfer the Work, where such license applies only to
47 | those patent claims licensable by me that are necessarily infringed by my
48 | Contribution(s) alone or by combination of my Contribution(s) with the
49 | Work to which such Contribution(s) was submitted. If any entity institutes
50 | patent litigation against me or any other entity (including a cross-claim
51 | or counterclaim in a lawsuit) alleging that my Contribution, or the Work to
52 | which I have contributed, constitutes direct or contributory patent
53 | infringement, then any patent licenses granted to that entity under this
54 | Agreement for that Contribution or Work shall terminate as of the date such
55 | litigation is filed.
56 |
57 | Signed by git commit adding my legal name and git username:
58 |
59 | Written in 2019 by Ayman Abi Abdallah - aabiabdallah
60 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Because of a lack of patent licensing in CC0 1.0 this software includes a
2 | separate Grant of Patent License adapted from Apache License 2.0.
3 |
4 | ===========================================================================
5 |
6 | Creative Commons Legal Code
7 |
8 | CC0 1.0 Universal
9 |
10 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
11 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
12 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
13 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
14 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
15 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
16 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
17 | HEREUNDER.
18 |
19 | Statement of Purpose
20 |
21 | The laws of most jurisdictions throughout the world automatically confer
22 | exclusive Copyright and Related Rights (defined below) upon the creator
23 | and subsequent owner(s) (each and all, an "owner") of an original work of
24 | authorship and/or a database (each, a "Work").
25 |
26 | Certain owners wish to permanently relinquish those rights to a Work for
27 | the purpose of contributing to a commons of creative, cultural and
28 | scientific works ("Commons") that the public can reliably and without fear
29 | of later claims of infringement build upon, modify, incorporate in other
30 | works, reuse and redistribute as freely as possible in any form whatsoever
31 | and for any purposes, including without limitation commercial purposes.
32 | These owners may contribute to the Commons to promote the ideal of a free
33 | culture and the further production of creative, cultural and scientific
34 | works, or to gain reputation or greater distribution for their Work in
35 | part through the use and efforts of others.
36 |
37 | For these and/or other purposes and motivations, and without any
38 | expectation of additional consideration or compensation, the person
39 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she
40 | is an owner of Copyright and Related Rights in the Work, voluntarily
41 | elects to apply CC0 to the Work and publicly distribute the Work under its
42 | terms, with knowledge of his or her Copyright and Related Rights in the
43 | Work and the meaning and intended legal effect of CC0 on those rights.
44 |
45 | 1. Copyright and Related Rights. A Work made available under CC0 may be
46 | protected by copyright and related or neighboring rights ("Copyright and
47 | Related Rights"). Copyright and Related Rights include, but are not
48 | limited to, the following:
49 |
50 | i. the right to reproduce, adapt, distribute, perform, display,
51 | communicate, and translate a Work;
52 | ii. moral rights retained by the original author(s) and/or performer(s);
53 | iii. publicity and privacy rights pertaining to a person's image or
54 | likeness depicted in a Work;
55 | iv. rights protecting against unfair competition in regards to a Work,
56 | subject to the limitations in paragraph 4(a), below;
57 | v. rights protecting the extraction, dissemination, use and reuse of data
58 | in a Work;
59 | vi. database rights (such as those arising under Directive 96/9/EC of the
60 | European Parliament and of the Council of 11 March 1996 on the legal
61 | protection of databases, and under any national implementation
62 | thereof, including any amended or successor version of such
63 | directive); and
64 | vii. other similar, equivalent or corresponding rights throughout the
65 | world based on applicable law or treaty, and any national
66 | implementations thereof.
67 |
68 | 2. Waiver. To the greatest extent permitted by, but not in contravention
69 | of, applicable law, Affirmer hereby overtly, fully, permanently,
70 | irrevocably and unconditionally waives, abandons, and surrenders all of
71 | Affirmer's Copyright and Related Rights and associated claims and causes
72 | of action, whether now known or unknown (including existing as well as
73 | future claims and causes of action), in the Work (i) in all territories
74 | worldwide, (ii) for the maximum duration provided by applicable law or
75 | treaty (including future time extensions), (iii) in any current or future
76 | medium and for any number of copies, and (iv) for any purpose whatsoever,
77 | including without limitation commercial, advertising or promotional
78 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
79 | member of the public at large and to the detriment of Affirmer's heirs and
80 | successors, fully intending that such Waiver shall not be subject to
81 | revocation, rescission, cancellation, termination, or any other legal or
82 | equitable action to disrupt the quiet enjoyment of the Work by the public
83 | as contemplated by Affirmer's express Statement of Purpose.
84 |
85 | 3. Public License Fallback. Should any part of the Waiver for any reason
86 | be judged legally invalid or ineffective under applicable law, then the
87 | Waiver shall be preserved to the maximum extent permitted taking into
88 | account Affirmer's express Statement of Purpose. In addition, to the
89 | extent the Waiver is so judged Affirmer hereby grants to each affected
90 | person a royalty-free, non transferable, non sublicensable, non exclusive,
91 | irrevocable and unconditional license to exercise Affirmer's Copyright and
92 | Related Rights in the Work (i) in all territories worldwide, (ii) for the
93 | maximum duration provided by applicable law or treaty (including future
94 | time extensions), (iii) in any current or future medium and for any number
95 | of copies, and (iv) for any purpose whatsoever, including without
96 | limitation commercial, advertising or promotional purposes (the
97 | "License"). The License shall be deemed effective as of the date CC0 was
98 | applied by Affirmer to the Work. Should any part of the License for any
99 | reason be judged legally invalid or ineffective under applicable law, such
100 | partial invalidity or ineffectiveness shall not invalidate the remainder
101 | of the License, and in such case Affirmer hereby affirms that he or she
102 | will not (i) exercise any of his or her remaining Copyright and Related
103 | Rights in the Work or (ii) assert any associated claims and causes of
104 | action with respect to the Work, in either case contrary to Affirmer's
105 | express Statement of Purpose.
106 |
107 | 4. Limitations and Disclaimers.
108 |
109 | a. No trademark or patent rights held by Affirmer are waived, abandoned,
110 | surrendered, licensed or otherwise affected by this document.
111 | b. Affirmer offers the Work as-is and makes no representations or
112 | warranties of any kind concerning the Work, express, implied,
113 | statutory or otherwise, including without limitation warranties of
114 | title, merchantability, fitness for a particular purpose, non
115 | infringement, or the absence of latent or other defects, accuracy, or
116 | the present or absence of errors, whether or not discoverable, all to
117 | the greatest extent permissible under applicable law.
118 | c. Affirmer disclaims responsibility for clearing rights of other persons
119 | that may apply to the Work or any use thereof, including without
120 | limitation any person's Copyright and Related Rights in the Work.
121 | Further, Affirmer disclaims responsibility for obtaining any necessary
122 | consents, permissions or other rights required for any use of the
123 | Work.
124 | d. Affirmer understands and acknowledges that Creative Commons is not a
125 | party to this document and has no duty or obligation with respect to
126 | this CC0 or use of the Work.
127 |
128 |
129 | ===========================================================================
130 |
131 | Grant of Patent License
132 |
133 | "License" shall mean the terms and conditions for use, reproduction, and
134 | distribution.
135 |
136 | "Licensor" shall mean the original copyright owner or entity authorized by
137 | the original copyright owner that is granting the License.
138 |
139 | "Legal Entity" shall mean the union of the acting entity and all other
140 | entities that control, are controlled by, or are under common control with
141 | that entity. For the purposes of this definition, "control" means (i) the
142 | power, direct or indirect, to cause the direction or management of such
143 | entity, whether by contract or otherwise, or (ii) ownership of fifty
144 | percent (50%) or more of the outstanding shares, or (iii) beneficial
145 | ownership of such entity.
146 |
147 | "You" (or "Your") shall mean an individual or Legal Entity exercising
148 | permissions granted by this License.
149 |
150 | "Source" form shall mean the preferred form for making modifications,
151 | including but not limited to software source code, documentation source,
152 | and configuration files.
153 |
154 | "Object" form shall mean any form resulting from mechanical transformation
155 | or translation of a Source form, including but not limited to compiled
156 | object code, generated documentation, and conversions to other media types.
157 |
158 | "Work" shall mean the work of authorship, whether in Source or Object form,
159 | made available under the License, as indicated by a copyright notice that
160 | is included in or attached to the work.
161 |
162 | "Derivative Works" shall mean any work, whether in Source or Object form,
163 | that is based on (or derived from) the Work and for which the editorial
164 | revisions, annotations, elaborations, or other modifications represent, as
165 | a whole, an original work of authorship. For the purposes of this License,
166 | Derivative Works shall not include works that remain separable from, or
167 | merely link (or bind by name) to the interfaces of, the Work and
168 | Derivative Works thereof.
169 |
170 | "Contribution" shall mean any work of authorship, including the original
171 | version of the Work and any modifications or additions to that Work or
172 | Derivative Works thereof, that is intentionally submitted to Licensor for
173 | inclusion in the Work by the copyright owner or by an individual or Legal
174 | Entity authorized to submit on behalf of the copyright owner. For the
175 | purposes of this definition, "submitted" means any form of electronic,
176 | verbal, or written communication sent to the Licensor or its
177 | representatives, including but not limited to communication on electronic
178 | mailing lists, source code control systems, and issue tracking systems that
179 | are managed by, or on behalf of, the Licensor for the purpose of discussing
180 | and improving the Work, but excluding communication that is conspicuously
181 | marked or otherwise designated in writing by the copyright owner as "Not a
182 | Contribution."
183 |
184 | "Contributor" shall mean Licensor and any individual or Legal Entity on
185 | behalf of whom a Contribution has been received by Licensor and
186 | subsequently incorporated within the Work.
187 |
188 | Each Contributor hereby grants to You a perpetual, worldwide,
189 | non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
190 | this section) patent license to make, have made, use, offer to sell, sell,
191 | import, and otherwise transfer the Work, where such license applies only to
192 | those patent claims licensable by such Contributor that are necessarily
193 | infringed by their Contribution(s) alone or by combination of their
194 | Contribution(s) with the Work to which such Contribution(s) was submitted.
195 | If You institute patent litigation against any entity (including a
196 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
197 | Contribution incorporated within the Work constitutes direct or
198 | contributory patent infringement, then any patent licenses granted to You
199 | under this License for that Work shall terminate as of the date such
200 | litigation is filed.
201 |
--------------------------------------------------------------------------------
/MoquiConf.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Moqui Workflow Component
2 |
3 | Extendable workflow engine for the [Moqui Framework](https://www.moqui.org).
4 |
5 | ## Table of Contents
6 |
7 | - [Concepts](#concepts)
8 | - [Installation](#installation)
9 | - [Configuration](#configuration)
10 | - [Artifact Groups](#artifact-groups)
11 | - [Authors](#authors)
12 | - [License](#license)
13 |
14 | ## Concepts
15 |
16 | A `Workflow` is a set of activities involved in moving from the beginning to the end of a work process.
17 | Each workflow is linked to a single entity by means of a `WorkflowType`.
18 | When the workflow engine is triggered for a specific entity value it creates a new `WorkflowInstance`.
19 |
20 | ## Installation
21 |
22 | You will be carrying out these steps to install the workflow engine.
23 |
24 | * Download the Moqui Framework (optional)
25 | * Download the [myaddons.xml](myaddons.xml) file
26 | * Download the workflow component
27 |
28 | ### Download the Moqui Framework
29 |
30 | In case you don't have the Moqui Framework yet then you can can download it using this command:
31 |
32 | ```shell
33 | $ git clone https://github.com/moqui/moqui-framework.git
34 | ```
35 |
36 | ### Download the myaddons.xml file
37 |
38 | Using **wget**:
39 |
40 | ```shell
41 | $ cd moqui-framework
42 | $ wget https://raw.githubusercontent.com/netvariant/moqui-workflow/master/myaddons.xml
43 | ```
44 |
45 | Using **curl**:
46 |
47 | ```shell
48 | $ cd moqui-framework
49 | $ curl -O https://raw.githubusercontent.com/netvariant/moqui-workflow/master/myaddons.xml
50 | ```
51 |
52 | If neither command is available then download [myaddons.xml](myaddons.xml) file manually and copy it to the Moqui Framework root directory.
53 |
54 | ### Download the workflow component
55 |
56 | You're all set to download the workflow component, just run this command and you're done!
57 |
58 | ```shell
59 | $ ./gradlew getComponent -Pcomponent=moqui-workflow
60 | ```
61 |
62 | ## Configuration
63 |
64 | Configuring the workflow engine involves these tasks.
65 |
66 | * Define workflow types
67 | * Expose entity fields
68 | * Design a workflow
69 | * Trigger workflow engine
70 |
71 | ### Define workflow types
72 |
73 | Workflow types are stores in the `moqui.workflow.WorkflowType` entity and must be defined before the workflow engine is used.
74 | You can define a new workflow type in your component seed data as follows:
75 |
76 | ```xml
77 |
78 | ```
79 |
80 | A brief explanation of the workflow type fields can be found in the table below:
81 |
82 | | Field Name | Description |
83 | | :--- | :--- |
84 | | typeId | Type primary key |
85 | | typeName | User friendly type name |
86 | | statusTypeId | Allowed statuses for this type of workflow |
87 | | primaryEntityName | Entity used by the workflow engine for write operations |
88 | | primaryViewEntityName | View entity used by the workflow engine for read operations |
89 | | primaryKeyField | Entity primary key field name |
90 |
91 | ### Expose entity fields
92 |
93 | You may not wish to expose all entity fields in the workflow designer. You can control this using the `moqui.entity.EntityField` entity.
94 | You can define a new workflow type in your component seed data as follows:
95 |
96 | ```xml
97 |
98 | ```
99 |
100 | ### Design a workflow
101 |
102 | You can design workflows using the standalone [Workflow Designer](https://github.com/Netvariant/workflow-designer).
103 |
104 | ### Trigger workflow engine
105 |
106 | You can start/stop workflow instances using Moqui services. The workflow engine comes with the following services:
107 |
108 | | Service Name | Description |
109 | | :--- | :--- |
110 | | moqui.workflow.WorkflowServices.create#WorkflowInstance | Creates a new workflow instance |
111 | | moqui.workflow.WorkflowServices.start#WorkflowInstance | Starts an existing workflow instance |
112 | | moqui.workflow.WorkflowServices.suspend#WorkflowInstance | Suspends an existing workflow instance |
113 | | moqui.workflow.WorkflowServices.resume#WorkflowInstance | Resumed a suspended workflow instance |
114 | | moqui.workflow.WorkflowServices.abort#WorkflowInstance | Aborts an active workflow instance |
115 |
116 | In a real life scenario you calling the above services using SECA/EECA rules.
117 |
118 | ## Artifact Groups
119 |
120 | Loading the `moqui-workflow` component seed data will automatically create two artifact groups. Add them to your user groups to grant members access.
121 |
122 | | Group Name | Description |
123 | | :--- | :--- |
124 | | Workflow App | Allows access to the workflow application within Moqui |
125 | | Moqui Workflow REST API | Allows access to the workflow REST APIs, this is required by the workflow designer |
126 |
127 | ## Authors
128 |
129 | This project was build with :heart: by the good fellas at [Netvariant](https://www.netvariant.com).
130 |
131 | ## License
132 |
133 | [](https://github.com/Netvariant/moqui-workflow/blob/master/LICENSE.md)
134 |
135 | This project is licensed under the CC0 License - see the [LICENSE.md](LICENSE.md) file for details.
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'java'
3 | id 'groovy'
4 | }
5 |
6 | group 'org.moqui.workflow'
7 | version '1.0.0'
8 | description 'Moqui Workflow'
9 |
10 | sourceCompatibility = 1.8
11 | targetCompatibility = 1.8
12 |
13 | def jarBaseName = 'moqui-workflow'
14 | def moquiDir = projectDir.parentFile.parentFile.parentFile
15 | def frameworkDir = file(moquiDir.absolutePath + '/framework')
16 | def libDir = projectDir.absolutePath + '/lib'
17 |
18 | repositories {
19 | flatDir name: 'frameworkLib', dirs: frameworkDir.absolutePath + '/lib'
20 | flatDir name: 'projectLib', dirs: projectDir.absolutePath + '/lib'
21 | mavenCentral()
22 | }
23 |
24 | dependencies {
25 | compile(
26 | project(':framework'),
27 | project(':runtime:component:moqui-elasticsearch'),
28 | // Apache Commons
29 | 'org.apache.commons:commons-lang3:3.8',
30 | // JSON
31 | 'org.json:json:20180813'
32 | )
33 | testCompile(
34 | project(':framework').configurations.testCompile.allDependencies
35 | )
36 | }
37 |
38 | // Log4j has annotation processors, disable to avoid warning
39 | tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
40 | tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }
41 |
42 | // by default the Java plugin runs test on build, change to not do that (only run test if explicit task)
43 | check.dependsOn.clear()
44 |
45 | task cleanLib(type: Delete) {
46 | delete fileTree(dir: libDir, include: '*')
47 | }
48 | clean.dependsOn cleanLib
49 |
50 | task copyDependencies {
51 | doLast {
52 | copy {
53 | from (configurations.runtime
54 | - project(':framework').configurations.runtime
55 | - project(':runtime:component:moqui-elasticsearch').configurations.runtime
56 | - project(':runtime:component:moqui-workflow').jar.archivePath
57 | )
58 | into file(libDir)
59 | }
60 | }
61 | }
62 | copyDependencies.dependsOn cleanLib
63 |
64 | test {
65 | dependsOn cleanTest
66 | include '**/MoquiWorkflowSuite.class'
67 |
68 | systemProperty 'moqui.runtime', moquiDir.absolutePath + '/runtime'
69 | systemProperty 'moqui.conf', 'conf/MoquiDevConf.xml'
70 | systemProperty 'moqui.init.static', 'true'
71 |
72 | // show standard out and standard error of the test JVM(s) on the console
73 | testLogging.showStandardStreams = true
74 | testLogging.showExceptions = true
75 |
76 | classpath += files(sourceSets.main.output.classesDirs)
77 | // filter out classpath entries that don't exist (gradle adds a bunch of these), or ElasticSearch JarHell will blow up
78 | classpath = classpath.filter { it.exists() }
79 |
80 | beforeTest { descriptor -> logger.lifecycle("Running test: ${descriptor}") }
81 | }
82 |
83 | jar {
84 | destinationDir = file(libDir)
85 | baseName = jarBaseName
86 | }
87 | jar.dependsOn copyDependencies
--------------------------------------------------------------------------------
/component.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/data/BasicData.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/data/ComponentEmailData.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/data/ComponentMessageDataEn.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/data/ComponentSecurityData.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/data/ComponentServiceJobData.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/data/EntityData.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/data/SecurityData.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/data/WorkflowDemoData.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/entity/EntityEntities.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 | While we can use the EntityFacade to access ALL entity fields, this entity provides a convenient way to access entity fields we wish to expose to the application users. This is particularly useful in search and condition fields.
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/entity/EntityViewEntities.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/netvariant/moqui-workflow/2ed01d6ded71d6bb25c49621cd973b7c447ef967/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip
6 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/myaddons.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/screen/Workflow.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/screen/Workflow/WorkflowInstance.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/screen/Workflow/WorkflowInstance/EditWorkflowInstance.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/screen/Workflow/WorkflowInstance/FindWorkflowInstance.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/screen/Workflow/WorkflowInstance/FindWorkflowInstanceEvent.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/screen/Workflow/WorkflowInstance/FindWorkflowInstanceVariable.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/service/org/moqui/basic/BasicServices.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/service/org/moqui/entity/EntityFieldServices.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/service/org/moqui/security/SecurityServices.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/service/org/moqui/workflow/WorkflowServices.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
--------------------------------------------------------------------------------
/service/workflow.rest.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
--------------------------------------------------------------------------------
/service/workflow.secas.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * This settings file was generated by the Gradle 'init' task.
3 | *
4 | * The settings file is used to specify which projects to include in your build.
5 | * In a single project build this file can be empty or even removed.
6 | *
7 | * Detailed information about configuring a multi-project build in Gradle can be found
8 | * in the user guide at https://docs.gradle.org/4.3.1/userguide/multi_project_builds.html
9 | */
10 |
11 | rootProject.name = 'moqui-workflow'
12 |
--------------------------------------------------------------------------------
/src/main/java/org/moqui/basic/StatusItemService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This software is in the public domain under CC0 1.0 Universal plus a
3 | * Grant of Patent License.
4 | *
5 | * To the extent possible under law, the author(s) have dedicated all
6 | * copyright and related and neighboring rights to this software to the
7 | * public domain worldwide. This software is distributed without any
8 | * warranty.
9 | *
10 | * You should have received a copy of the CC0 Public Domain Dedication
11 | * along with this software (see the LICENSE.md file). If not, see
12 | * .
13 | */
14 | package org.moqui.basic;
15 |
16 | import org.apache.commons.lang3.time.StopWatch;
17 | import org.moqui.context.ExecutionContext;
18 | import org.moqui.context.MessageFacade;
19 | import org.moqui.context.UserFacade;
20 | import org.moqui.entity.*;
21 | import org.moqui.service.ServiceFacade;
22 | import org.moqui.util.ContextStack;
23 | import org.moqui.util.ContextUtil;
24 | import org.moqui.util.StringUtil;
25 | import org.slf4j.Logger;
26 | import org.slf4j.LoggerFactory;
27 |
28 | import java.util.*;
29 |
30 | /**
31 | * Service to retrieve status items.
32 | */
33 | @SuppressWarnings("unused")
34 | public class StatusItemService {
35 |
36 | /**
37 | * Class logger.
38 | */
39 | private final Logger logger = LoggerFactory.getLogger(getClass());
40 |
41 | /**
42 | * Finds status items.
43 | *
44 | * @param ec Execution context
45 | * @return Output parameter map
46 | */
47 | public Map findStatusItems(ExecutionContext ec) {
48 |
49 | // start the stop watch
50 | StopWatch stopWatch = new StopWatch();
51 | stopWatch.start();
52 |
53 | // shortcuts for convenience
54 | ContextStack cs = ec.getContext();
55 | MessageFacade mf = ec.getMessage();
56 | EntityFacade ef = ec.getEntity();
57 | ServiceFacade sf = ec.getService();
58 | UserFacade uf = ec.getUser();
59 |
60 | // get the parameters
61 | int pageIndex = (Integer) cs.getOrDefault("pageIndex", 0);
62 | int pageSize = (Integer) cs.getOrDefault("pageSize", 10);
63 | String orderByField = (String) cs.getOrDefault("orderByField", "statusId");
64 | String filter = (String) cs.getOrDefault("filter", null);
65 |
66 | // generate a new log ID
67 | String logId = ContextUtil.getLogId(ec);
68 | logger.debug(String.format("[%s] Finding status items ...", logId));
69 | logger.debug(String.format("[%s] Param pageIndex=%s", logId, pageIndex));
70 | logger.debug(String.format("[%s] Param pageSize=%s", logId, pageSize));
71 | logger.debug(String.format("[%s] Param orderByField=%s", logId, orderByField));
72 | logger.debug(String.format("[%s] Param filter=%s", logId, filter));
73 |
74 | // prepare the conditions
75 | EntityConditionFactory ecf = ef.getConditionFactory();
76 | EntityCondition findCondition = ecf.getTrueCondition();
77 |
78 | // add the filter
79 | if(StringUtil.isValidElasticsearchQuery(filter)) {
80 | Map resp = sf.sync().name("org.moqui.search.SearchServices.search#DataDocuments")
81 | .parameter("indexName", "workflow")
82 | .parameter("documentType", "MoquiStatusItem")
83 | .parameter("queryString", filter)
84 | .call();
85 |
86 | Set idSet = new HashSet<>();
87 | if(resp!=null && resp.containsKey("documentList")) {
88 | List documentList = (List) resp.get("documentList");
89 | for (Object documentObj : documentList) {
90 | if(documentObj instanceof Map) {
91 | idSet.add((String) ((Map) documentObj).get("statusId"));
92 | }
93 | }
94 | }
95 |
96 | findCondition = ecf.makeCondition(
97 | findCondition,
98 | EntityCondition.JoinOperator.AND,
99 | ecf.makeCondition("statusId", EntityCondition.ComparisonOperator.IN, idSet)
100 | );
101 | }
102 |
103 | // find
104 | String userId = uf.getUserId();
105 | ArrayList