9 Replies Latest reply on Feb 9, 2015 9:17 AM by rogerparkinson

    Trying to make REST work from Workbench

    rogerparkinson

      I wanted to add a couple of REST tasks to my process in workbench (kie-wb-6.1.0.Final-wildfly) and found that REST is not listed in the service tasks.

      Then I happened to be looking in the repository view at the same project, opened the bpmn2 file and found that REST is present there in the service tasks.

      I also noticed that word wraps on the task names, which had been lost, were back, which doesn't matter but was interesting.

       

      So I added the two REST tasks, saved the process and went back to the Project view to see what it would do. Here's a screenshot of the repo view:

      repoview.png

      The project view looks like this:

      projectview.png

      It still doesn't list REST as a service task and it obviously isn't recognising the two tasks I've added.

       

      So what should I do? Is there something I need to do to tell Workbench(project view) about REST? There was in Eclipse, but this isn't Eclipse.

      Attached are two screen shots of the two views.

      Thanks

      Roger

        • 1. Re: Trying to make REST work from Workbench
          rogerparkinson

          Okay, to make it more mysterious I restarted Wildfly for other reasons a couple of times and checked it again. First time I checked it the REST task was showing in the process diagram again, but it was missing from the list under Service Task.

          Another restart and it was back on the list. I'd like to call that solved but I don't know what made it go away, so I don't know how long it will stay working.

           

          ...and it's gone again. I tried to run the process in Workbench and it failed with an error (my url isn't quite right yet), so when I went back to Authoring to change it the process diagram looks like the second screen shot and REST is missing from the service tasks.

          • 2. Re: Trying to make REST work from Workbench
            sanjay05222

            Roger

            I have also observed the similar behavior , as per best of my knowledge we have to make sure that the project which we are working on and the process which belong to that project has the workitem.wid file have declared the REST and WS as the task.

            If you see that in the wid file you dont have those workitem configured then you will have to add them manually this might fix the issue. hope this helps.

            Sanjay Gautam

            1 of 1 people found this helpful
            • 3. Re: Trying to make REST work from Workbench
              rogerparkinson

              Thanks Sanjay. The entries are in the wid file and have been all along. Good to have that confirmed though.

              • 4. Re: Trying to make REST work from Workbench
                rogerparkinson

                I have a little more information. I found that about half the time restarting wildfly would change it to good, and sometimes to bad. Same with switching from Authoring to other tabs such as Process Definitions.

                As of this afternoon it has stayed bad regardless of what I do. I also see there are these two entries in the log:

                [-1,-1]: Process 'Non Medical Claim' [com.ghiplus.knowledge.claims.core.NonMedicalClaim]: Task node 'Reserve HCA Funds' [14] has no work name.

                [-1,-1]: Process 'Non Medical Claim' [com.ghiplus.knowledge.claims.core.NonMedicalClaim]: Task node 'Unreserve HCA Funds' [15] has no work name.

                These two task nodes are the two REST nodes in the process. I had a similar error earlier when I got a process working in Eclipse (tested it there with JUnit as well) then pushed it to the git repo so that WB could see it. WB refused to deploy it because of this 'no work name' error. I gave up on the idea of using Eclipse at that point. But possibly Eclipse is okay and WB simply lost its way like it has now.

                 

                I'm really stuck on this one so any help much appreciated

                Thanks

                Roger

                • 5. Re: Trying to make REST work from Workbench
                  sanjay05222

                  Hi Roger ,

                   

                  I faced the same issue today where I lost all the work name for a while, but some how I was able to recover it by reverting to my last best available inside the repository and revert the last best instance , your work names will recover.

                  you have to go to authoring > and navigate to the repository. 

                   

                  If that doesn't help them close all the instance of the Jbpm restart and re commit the project with force commit option and then open the bpmn files and see if they got it associated with the right "work name"

                  I hope you are aware of when this error comes ? just incase not then it happens when your "Tasks" are not having the "Type"

                   

                  Can you check how many wid files are there in your project as well some how i created a new Business Process in different package in the same project on creation it created one more wid file at that level. Which actually confused the other package where actually I have the working wid which I want to use and hence I lost all the "Type"  since kie resolved it to one which was newly created and ignore the one which I was using with my custom work items . I hope this helps there is no exact answer but I doubt that you have two  or workitem

                   

                  Thanks

                  Sanjay Gautam

                  • 6. Re: Trying to make REST work from Workbench
                    sanjay05222

                    Roger Parkinson wrote:

                     

                    I wanted to add a couple of REST tasks to my process in workbench (kie-wb-6.1.0.Final-wildfly) and found that REST is not listed in the service tasks.

                    Then I happened to be looking in the repository view at the same project, opened the bpmn2 file and found that REST is present there in the service tasks.

                    I also noticed that word wraps on the task names, which had been lost, were back, which doesn't matter but was interesting.

                     

                    So I added the two REST tasks, saved the process and went back to the Project view to see what it would do. Here's a screenshot of the repo view:

                    repoview.png

                    The project view looks like this:

                    projectview.png

                    It still doesn't list REST as a service task and it obviously isn't recognising the two tasks I've added.

                     

                    So what should I do? Is there something I need to do to tell Workbench(project view) about REST? There was in Eclipse, but this isn't Eclipse.

                    Attached are two screen shots of the two views.

                    Thanks

                    Roger

                     

                    Tip About Messed Process Diagram Up Arrows

                    if you see your arrows gone wild like in the attached image,  just close the diagram and reopen the diagram it will recover and re align to the shape it was saved. Don't save in that messed up state otherwise you have to re-arrange them again.  I believe you could figure out this work around with the messed up diagram. just thought of sharing it just in case.

                     

                    thanks

                    SanjayGautam

                    1 of 1 people found this helpful
                    • 7. Re: Trying to make REST work from Workbench
                      sanjay05222

                      Roger Parkinson wrote:

                       

                      I have a little more information. I found that about half the time restarting wildfly would change it to good, and sometimes to bad. Same with switching from Authoring to other tabs such as Process Definitions.

                      As of this afternoon it has stayed bad regardless of what I do. I also see there are these two entries in the log:

                      [-1,-1]: Process 'Non Medical Claim' [com.ghiplus.knowledge.claims.core.NonMedicalClaim]: Task node 'Reserve HCA Funds' [14] has no work name.

                      [-1,-1]: Process 'Non Medical Claim' [com.ghiplus.knowledge.claims.core.NonMedicalClaim]: Task node 'Unreserve HCA Funds' [15] has no work name.

                      These two task nodes are the two REST nodes in the process. I had a similar error earlier when I got a process working in Eclipse (tested it there with JUnit as well) then pushed it to the git repo so that WB could see it. WB refused to deploy it because of this 'no work name' error. I gave up on the idea of using Eclipse at that point. But possibly Eclipse is okay and WB simply lost its way like it has now.

                       

                      I'm really stuck on this one so any help much appreciated

                      Thanks

                      Roger

                      Try Force Commit and check how many wid files are there ? if there are duplicates then delete one which doesn't not have your work item defined. hope this helps.

                      • 8. Re: Trying to make REST work from Workbench
                        rogerparkinson

                        SANJAY GAUTAM wrote:

                         

                        Hi Roger ,

                         

                        I faced the same issue today where I lost all the work name for a while, but some how I was able to recover it by reverting to my last best available inside the repository and revert the last best instance , your work names will recover.

                        you have to go to authoring > and navigate to the repository.

                         

                        If that doesn't help them close all the instance of the Jbpm restart and re commit the project with force commit option and then open the bpmn files and see if they got it associated with the right "work name"

                        I hope you are aware of when this error comes ? just incase not then it happens when your "Tasks" are not having the "Type"

                         

                        Can you check how many wid files are there in your project as well some how i created a new Business Process in different package in the same project on creation it created one more wid file at that level. Which actually confused the other package where actually I have the working wid which I want to use and hence I lost all the "Type"  since kie resolved it to one which was newly created and ignore the one which I was using with my custom work items . I hope this helps there is no exact answer but I doubt that you have two  or workitem

                         

                        Thanks

                        Sanjay Gautam

                        Thanks for the help, Sanjay. I can't check this now 'cos I've removed the REST stuff so I can get the other stuff done (need to show the boss something working...).

                        But I was seeing it come and go on a random basis. You are likely right that shutting down and restarting and making sure I don't save the bad version helps.

                        However I am quite sure there was only one wid file in the project, well almost. I've several repos but I notice the repo explorer seems to think that all the _other_ repos are in each repo sitting in a subdir. Possibly this is just a bug in the repo explorer. Anyway I've moved on to 6.2.0.CR4 which seems to have a lot of bugs fixed, though there is one show stopper which is holding me up (it's on another thread).

                        • 9. Re: Trying to make REST work from Workbench
                          rogerparkinson

                          I have not seen this problem since I moved to 6.2.x so I'll calling it fixed.