@@ -51,6 +51,48 @@ public class Script implements BaseScript {
5151{"z" :300.0 }
5252```
5353
54+ ### Example using the ProcessMaker 4 SDK
55+ Get all users' email addresses
56+ ``` java
57+ import ProcessMaker_Client.ApiClient ;
58+ import java.io.* ;
59+ import java.util.* ;
60+
61+ import ProcessMaker_Client.ApiClient ;
62+ import ProcessMaker_Client.ApiException ;
63+ import ProcessMaker_Client.Configuration ;
64+ import ProcessMaker_Client.auth.* ;
65+ import ProcessMaker_Model.* ;
66+ import ProcessMaker_Api.UsersApi ;
67+
68+ public class Script implements BaseScript {
69+ public void execute (Map<String , Object > data , Map<String , Object > config , Map<String , Object > output , ApiClient api ) {
70+ UsersApi apiInstance = new UsersApi (api);
71+ String filter = " " ;
72+ String orderBy = " id" ;
73+ String orderDirection = " asc" ;
74+ Integer perPage = 100 ;
75+ String include = " " ;
76+
77+ try {
78+ InlineResponse20019 result = apiInstance. getUsers(filter, orderBy, orderDirection, perPage, include);
79+
80+ List<String > emails = new ArrayList<> ();
81+ for (Users u : result. getData()) {
82+ emails. add(u. getEmail());
83+ }
84+ output. put(" emails" , emails);
85+
86+ } catch (ApiException e) {
87+ System . err. println(" Exception when calling UsersApi" );
88+ System . err. println(" Status code: " + e. getCode());
89+ System . err. println(" Reason: " + e. getResponseBody());
90+ e. printStackTrace();
91+ }
92+ }
93+ }
94+ ```
95+
5496## Command Line Usage
5597``` bash
5698$ docker run -v < path to local data.json> :/opt/executor/data.json \
0 commit comments