3

I'm reading the URL for Rest Service Tasks from custom WorkItem in JBPM - Business Central and in one case I have HumanTask before the reader, the WorkItem task, so it throws the exception bellow and i'm stuck. How can i fix this?

Unexpected error during processing org.jbpm.workflow.core.node.WorkItemNode cannot be cast to org.jbpm.workflow.core.node.HumanTaskNode: java.lang.ClassCastException: org.jbpm.workflow.core.node.WorkItemNode cannot be cast to org.jbpm.workflow.core.node.HumanTaskNode

image

Is it having work item after a human task right move? If not how can I take the URL I'm getting in work item? How can I fix this? Should I change the flow in order to fix it?

Bashir
  • 2,057
  • 5
  • 19
  • 44
xmlParser
  • 1,903
  • 4
  • 19
  • 48
  • 1
    what version of jbpm are you using? and please provide more details about : WorkItem , Save task, WorkItem 2, what are they doing? – Bashir Jun 24 '20 at 13:32
  • 7.33. WorkItem reads the url from config, has only output url (both are same, WorkItem and WorkItem2) save is a rest task, in the url there is set the url from the workitem, and it works but after human task i get that error – xmlParser Jun 24 '20 at 13:47
  • Do you have any experience or Idea about this @Bashir – xmlParser Jun 25 '20 at 07:39
  • I can't figure out where the problem is, may be if you provide more details it can be helpful, such as input/output of the tasks, how you're handling the human task. also can you tell in which step exactly you're getting the error. – Bashir Jun 25 '20 at 08:25
  • The error happens when i try to do update. For working item i have only one output - url, the url im getting from config file. Do you know how can i change the flow, if the workitem makes the problem because is after human task? – xmlParser Jun 25 '20 at 10:49
  • no it can't be the problem, did you change the version of your deployment? – Bashir Jun 25 '20 at 11:00
  • no, i think not. i've added some dependency jar that contains the custom workitem that reads the url from config, but i don't think that is the problem, since it works for the first case with save – xmlParser Jun 25 '20 at 11:25
  • I really don't find any problem with the provided information, just try to check if you have active processes and abort them. actually the Exception that you are getting may occur if you change the version of your deployment while you still have an active process instance or an active Task (check both and abort if you found one of them active). that's all I can help with – Bashir Jun 25 '20 at 11:36

1 Answers1

1

I have come across into the same problem quite a few times. It happens if you rebuild an artifact (e.g. for a hotfix, add an input or output variable in a task etc) in a version of some workflow and you have active instances with the same version in your runtime environment. Most probable cause is a mismatch in the byteArray which is saved in the ProcessInstanceInfo table in the database. Whenever I have experienced this error the particular instance becomes corrupt irrecoverably.

kpoasn
  • 11
  • 2