pefernan commented on code in PR #3655: URL: https://github.com/apache/incubator-kie-kogito-runtimes/pull/3655#discussion_r1760782347
########## jbpm/jbpm-usertask/src/test/java/org/jbpm/usertask/impl/DeadlineHelperTest.java: ########## @@ -0,0 +1,238 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.jbpm.usertask.impl; + +public class DeadlineHelperTest { + // + // @Test Review Comment: can we enable the tests? ########## jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceReader.java: ########## @@ -139,58 +95,10 @@ public NodeInstance read(MarshallerReaderContext context, Any value) { } private WorkItemNodeInstance instanceWorkItem(WorkItemNodeInstanceContent content) { Review Comment: Content is not being used in this method, can se remove it from the declaration? ########## jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/impl/META-INF/services/org.kie.kogito.internal.process.workitem.KogitoWorkItemHandlerFactory: ########## @@ -0,0 +1 @@ +org.kie.kogito.jbpm.usertask.internal.UserTaskKogitoWorkItemHandlerFactory Review Comment: Do we need registering the `UserTaskKWIHFactory` here? I don't see this module has a dep to `jbpm-usertasks` ########## jbpm/jbpm-usertask/src/main/java/org/kie/kogito/usertask/impl/model/HumanTaskHelper.java: ########## @@ -0,0 +1,152 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.usertask.impl.model; + +public class HumanTaskHelper { + + // private HumanTaskHelper() { Review Comment: Do we need this? I don't see any use in the code. ########## jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/marshallers/state/WorkItemNodeInstanceReader.java: ########## @@ -69,44 +57,6 @@ public NodeInstance read(MarshallerReaderContext context, Any value) { ProtobufVariableReader varReader = new ProtobufVariableReader(context); WorkItemNodeInstanceContent content = value.unpack(WorkItemNodeInstanceContent.class); WorkItemNodeInstance nodeInstance = instanceWorkItem(content); - if (nodeInstance instanceof HumanTaskNodeInstance) { - HumanTaskNodeInstance humanTaskNodeInstance = (HumanTaskNodeInstance) nodeInstance; - InternalHumanTaskWorkItem workItem = humanTaskNodeInstance.getWorkItem(); - Any workItemDataMessage = content.getWorkItemData(); - if (workItemDataMessage.is(HumanTaskWorkItemData.class)) { - HumanTaskWorkItemData workItemData = workItemDataMessage.unpack(HumanTaskWorkItemData.class); - humanTaskNodeInstance.getNotCompletedDeadlineTimers().putAll(buildDeadlines(workItemData.getCompletedDeadlinesMap())); - humanTaskNodeInstance.getNotCompletedReassigments().putAll(buildReassignments(workItemData.getCompletedReassigmentsMap())); - humanTaskNodeInstance.getNotStartedDeadlineTimers().putAll(buildDeadlines(workItemData.getStartDeadlinesMap())); - humanTaskNodeInstance.getNotStartedReassignments().putAll(buildReassignments(workItemData.getStartReassigmentsMap())); - - if (workItemData.hasTaskName()) { - workItem.setTaskName(workItemData.getTaskName()); - } - if (workItemData.hasTaskDescription()) { - workItem.setTaskDescription(workItemData.getTaskDescription()); - } - if (workItemData.hasTaskPriority()) { - workItem.setTaskPriority(workItemData.getTaskPriority()); - } - if (workItemData.hasTaskReferenceName()) { - workItem.setReferenceName(workItemData.getTaskReferenceName()); - } - if (workItemData.hasActualOwner()) { - workItem.setActualOwner(workItemData.getActualOwner()); - } - workItem.getAdminUsers().addAll(workItemData.getAdminUsersList()); - workItem.getAdminGroups().addAll(workItemData.getAdminGroupsList()); - workItem.getPotentialUsers().addAll(workItemData.getPotUsersList()); - workItem.getPotentialGroups().addAll(workItemData.getPotGroupsList()); - workItem.getExcludedUsers().addAll(workItemData.getExcludedUsersList()); - workItem.getComments().putAll(workItemData.getCommentsList().stream().map(this::buildComment).collect(Collectors.toMap(Comment::getId, Function.identity()))); - workItem.getAttachments().putAll(workItemData.getAttachmentsList().stream().map(this::buildAttachment).collect(Collectors.toMap(Attachment::getId, Function.identity()))); - - } - - } - RuleFlowProcessInstance ruleFlowProcessInstance = context.get(MarshallerContextName.MARSHALLER_PROCESS_INSTANCE); nodeInstance.internalSetWorkItemId(content.getWorkItemId()); InternalKogitoWorkItem workItem = (InternalKogitoWorkItem) nodeInstance.getWorkItem(); Review Comment: This cast is no longer needed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
