-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rpc and local attribute #17
Conversation
@@ -0,0 +1,8 @@ | |||
package io.xcherry.core.exception.persistence; | |||
|
|||
public class LocalAttributeNotFoundException extends RuntimeException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this exception? I don't remember a use case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's thrown when the attribute doesn't have a value, then I would prefer returning null. Because it's very common to start with empty/null and handling this exception is sometimes cumbersome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. For local attributes, null should be enough. While for app database, we throw not found exception if a table or column does not exist.
@@ -0,0 +1,8 @@ | |||
package io.xcherry.core.exception.persistence; | |||
|
|||
public class LocalAttributeSchemaNotMatchException extends RuntimeException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe LocalAttributeSchemaException extends ProcessDefinitionException
* @param key key of the local attribute. | ||
* @param value value of the local attribute. | ||
*/ | ||
public void upsertLocalAttribute(final String key, final Object value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably just setLocalAttribute
to pair with getLocalAttribute
. You can keep the comment to make it more clear
@@ -0,0 +1,66 @@ | |||
package io.xcherry.core.persistence.read_request; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it's probably not a good practice to use underscore for package name in Java. I never see that in any popular libraries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, making all lower case without _ is also recommended:
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
|
||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class LocalAttributeKeySchema { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like LocalAttributeDef
is shorter and clear enough just like in iwf Java SDK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is to be consistent with existing app database names. We are using xxxSchema.
* | ||
* @return the name as defined in a {@link RpcPersistenceReadRequest}. | ||
*/ | ||
String rpcPersistenceReadRequestName() default ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that we need another PR to clean up things a little big to get rid of App database later and move back to a simpler model like iwf..
This MR did: