@@ -59,6 +59,7 @@ public Long testRpcFunc1(Context context, String input, Persistence persistence,
5959 if (context .getWorkflowId ().isEmpty () || context .getWorkflowRunId ().isEmpty ()) {
6060 throw new RuntimeException ("invalid context" );
6161 }
62+ persistence .setDataAttribute (TEST_DATA_OBJECT_KEY , null );// test setting to null
6263 persistence .setDataAttribute (TEST_DATA_OBJECT_KEY , input );
6364 persistence .setSearchAttributeKeyword (TEST_SEARCH_ATTRIBUTE_KEYWORD , input );
6465 persistence .setSearchAttributeInt64 (TEST_SEARCH_ATTRIBUTE_INT , RPC_OUTPUT );
@@ -111,4 +112,36 @@ public Long testRpcFunc1Readonly(Context context, String input, Persistence pers
111112 }
112113 return RPC_OUTPUT ;
113114 }
115+
116+ @ RPC
117+ public void testRpcSetDataAttribute (Context context , String input , Persistence persistence , Communication communication ) {
118+ if (context .getWorkflowId ().isEmpty () || context .getWorkflowRunId ().isEmpty ()) {
119+ throw new RuntimeException ("invalid context" );
120+ }
121+ persistence .setDataAttribute (TEST_DATA_OBJECT_KEY , input );
122+ }
123+
124+ @ RPC
125+ public String testRpcGetDataAttribute (Context context , Persistence persistence , Communication communication ) {
126+ if (context .getWorkflowId ().isEmpty () || context .getWorkflowRunId ().isEmpty ()) {
127+ throw new RuntimeException ("invalid context" );
128+ }
129+ return persistence .getDataAttribute (TEST_DATA_OBJECT_KEY , String .class );
130+ }
131+
132+ @ RPC
133+ public void testRpcSetKeyword (Context context , String input , Persistence persistence , Communication communication ) {
134+ if (context .getWorkflowId ().isEmpty () || context .getWorkflowRunId ().isEmpty ()) {
135+ throw new RuntimeException ("invalid context" );
136+ }
137+ persistence .setSearchAttributeKeyword (TEST_SEARCH_ATTRIBUTE_KEYWORD , input );
138+ }
139+
140+ @ RPC
141+ public String testRpcGetKeyword (Context context , Persistence persistence , Communication communication ) {
142+ if (context .getWorkflowId ().isEmpty () || context .getWorkflowRunId ().isEmpty ()) {
143+ throw new RuntimeException ("invalid context" );
144+ }
145+ return persistence .getSearchAttributeKeyword (TEST_SEARCH_ATTRIBUTE_KEYWORD );
146+ }
114147}
0 commit comments