imixs / imixs-jsf-example

Imixs JEE Web Example Application
8 stars 9 forks source link

Login with multiple users #34

Closed Pooja-gupta1996 closed 3 years ago

Pooja-gupta1996 commented 5 years ago

@rsoika i have created bpmn with multiple lanes ,its loaded successfully with curl command ,i am using tomcat server and in the configuration file i have defined my user with their access but its not taking login from my user, is there any other place where i have to make changes? can u tell the step by step process where and how to create multiple users in imixs sample application?

rsoika commented 5 years ago

The login is independent from your model. First of all your users should be able to authenticate against the application. How a user can participate in a specific workflow is defined by the model and controlled by the workflow engine. So the first question is how to you manage you users and logins? I guess you have configured a file based security domain with the files 'sampleapp-roles.properties' and 'sampleapp-users.properties'. These files are defining who is allowed to access your application.

Pooja-gupta1996 commented 5 years ago

Login is independent I agree, I have logged in with my user but how they will co relate with my actors in my bpmn? My actors in bpmn and login user in imixs, how they will co relate and where the relationship will be defined?

rsoika commented 5 years ago

Hi, yes the example is in deed a little bit unclear. I have just improved it so you can better understand how things work. If you take a look into the project code (I just updated it) you will find two things.

TeamPlugin

The BPMN Model

As a result a new submitted ticket will be assigned to the members of the selected Tam. You just need to configure a Team which contains our own test users.

Pleas note, that I have updated the example project.

Pooja-gupta1996 commented 5 years ago

Sir, my issue is not with the workflow to UI, My current scenario is i have one BPMN which have some actors in multiple lanes in it, and one UI module of web page , and here comes an aspect i want to connect BPMN to the UI, i have uploaded BPMN and deployed WEb page but currently if i login with imixs user it is not authorized by $ISauther command so here come a scope my workflow is not connected to the current bpmn

Code of my BMPN is:

<?xml version="1.0" encoding="UTF-8"?>

ExclusiveGateway_4 Task_9 IntermediateCatchEvent_21 IntermediateCatchEvent_20 Task_1 IntermediateCatchEvent_1 StartEvent_1 Task_2 ExclusiveGateway_1 Task_10 EndEvent_1 IntermediateCatchEvent_4 IntermediateCatchEvent_6 IntermediateCatchEvent_5 Task_3 IntermediateCatchEvent_7 EndEvent_2 IntermediateCatchEvent_8 IntermediateCatchEvent_9 IntermediateCatchEvent_2 IntermediateCatchEvent_22 Task_4 Task_5 ExclusiveGateway_2 IntermediateCatchEvent_10 IntermediateCatchEvent_12 IntermediateCatchEvent_11 Task_6 IntermediateCatchEvent_13 IntermediateCatchEvent_14 IntermediateCatchEvent_15 IntermediateCatchEvent_16 IntermediateCatchEvent_17 Task_7 IntermediateCatchEvent_18 IntermediateCatchEvent_3 IntermediateCatchEvent_19 ExclusiveGateway_3 SequenceFlow_1 SequenceFlow_18 true SequenceFlow_1 SequenceFlow_11 SequenceFlow_8 SequenceFlow_3 SequenceFlow_3 SequenceFlow_5 true SequenceFlow_5 SequenceFlow_51 SequenceFlow_52 SequenceFlow_49 SequenceFlow_50 SequenceFlow_18 SequenceFlow_20 true SequenceFlow_20 SequenceFlow_25 SequenceFlow_55 SequenceFlow_56 SequenceFlow_53 true SequenceFlow_54 SequenceFlow_60 SequenceFlow_61 SequenceFlow_57 SequenceFlow_59 SequenceFlow_25 SequenceFlow_26 true SequenceFlow_26 SequenceFlow_34 SequenceFlow_64 SequenceFlow_66 SequenceFlow_2 SequenceFlow_62 true SequenceFlow_63 SequenceFlow_67 SequenceFlow_68 SequenceFlow_69 true SequenceFlow_70 SequenceFlow_4 SequenceFlow_6 SequenceFlow_31 SequenceFlow_31 SequenceFlow_34 SequenceFlow_35 true SequenceFlow_35 SequenceFlow_7 SequenceFlow_9 SequenceFlow_36 SequenceFlow_36 SequenceFlow_38 SequenceFlow_2 true SequenceFlow_38 SequenceFlow_48 SequenceFlow_11 SequenceFlow_48 SequenceFlow_49 SequenceFlow_50 SequenceFlow_52 SequenceFlow_51 SequenceFlow_53 SequenceFlow_54 SequenceFlow_55 SequenceFlow_56 SequenceFlow_57 SequenceFlow_59 SequenceFlow_61 SequenceFlow_60 SequenceFlow_62 SequenceFlow_63 SequenceFlow_66 SequenceFlow_64 SequenceFlow_67 SequenceFlow_68 SequenceFlow_69 SequenceFlow_70 SequenceFlow_4 SequenceFlow_6 SequenceFlow_7 SequenceFlow_9 SequenceFlow_8 Please have a look and help me in solving the connection. currently i am using your sample application imixsrealm , sample app roles and sample app users to connect UI with BPMN
rsoika commented 5 years ago

I can not read your file. Please attach the file to the issue. Do not post the code here.

Pooja-gupta1996 commented 5 years ago

incibpmn.txt sir please have look on it and tell me whats should i do

waiting for your response

rsoika commented 5 years ago

You must map your user roles to concrete userIds. This can be done by setting the userids in curled brackets: image

See also here.

Please let me know if this answers your question.

Pooja-gupta1996 commented 5 years ago

Thanks for your reply, it helps me in designing Project.

Sir now some question arises as you have seen, I have many lanes defined to different actors and I have defined users manually for different actors, but as my project is for a corporate use, so I have to define the users at runtime dynamically, may some user in the organization and few go out so defining users hardcode may not be feasible . please provide me the relevant method so that my project is turned into fully working and effective project Help me so the can make a few changes so that I can start to deploy my working project.

Pooja-gupta1996 commented 5 years ago

sir as per as I have added the user (ie admin) but when I am creating the the incident through GUI the its not saving seems its not able to connect bpmn Do i need to provide these actors entry to the ejb-jar.xml in my application??

or after configuring the user in incident.bpmn where else i need to change??

please help me out this sir

waiting for your response

rsoika commented 5 years ago

Again, please take a look into the TeamPlugin I mentioned earlier. This example maps the process actors into the item 'teamMembers'. In this case the mapping is

Team | teamMembers

Another solution is to inject Custom User Groups. This can be combined with custom authentication mechanism (e.g. Database or LDAP). Please note that the Imixs Software Solutions GmbH offers enterprise support for organizations. So if you need help for a solid application architecture a Service Subscription maybe the right solution. See also here

lodhipra commented 5 years ago

@rsoika can we run this imixs workflow application without enabling the rest service?

rsoika commented 5 years ago

just remove the maven dependency "imixs-workflow-jax-rs"

lodhipra commented 5 years ago

Sir I have done with designing complete project but on final deployment I deployed project war with database on another PC in jboss now I faces a problem in Controllers, as all the controllers designed like TeamListController are not displaying any information which are previously showing in previous pc but any new entry are visible on it but not the previous entries of other pc there is no error in Controllers and no error in database connection as because Controllers which are designed like TeamController are showing data. Can you please suggest me the way or change which can show data in list Controllers

rsoika commented 5 years ago

I guess you have changed the database without an update of the lucene index. You can do the following: 1.) delete the lucene index directory from the file system 2.) redeploy your application - this will initialize a rebuild of the lucene index (you will see the corresponding log messages in the server log)

lodhipra commented 5 years ago

But sir all the drop downs are showing the data and the fetch mechanism and all the database data fetching are working except the datatable list

rsoika commented 5 years ago

I can not understand what exactly your problem is. Can you try to describe your architecture in more detail.

lodhipra commented 5 years ago

sir i will describe my problem now in detail

As you can see you have two controller like TeamListController. I have also designed a page which have a list of users according to your page teamList.xhtml where i have can manage list of users, and i am working with two systems which have same data-source definition . If i enter a new records in one system and copy data record to another to another pc then here comes my real problem. your TeamListController is not showing any previous system records in the page here you see i have added two new records. But it doesn't mean that it is not excessing any record of prevoius pc because i am able to login with the users details which i have entered in prevoius system and excess accordingly(for this i have used Template as team controller). my previous system jave 10 users entry through which i can also login in my new pc but in the users record i am unable to see that users details in form. listpage addpage

datasource

Pooja-gupta1996 commented 5 years ago

as you can see in TeamController we are changing Team reference to team name as _teamName can you please provide me the syntax of how i can do this through document controller as you have used workflow controller but currently my project is not using it.

Code of Team Controller is here `/**

rsoika commented 5 years ago

@lodhipr : what did you mean with you 'copy data record to another to another pc'? What are you doing technical when you 'copy data'?

rsoika commented 5 years ago

@Pooja-gupta1995 also the DocumentController fires WorkflowEvents. So in your case you can react on the event 'DOCUMENT_BEFORE_SAVE' instead of the event 'WORKITEM_BEFORE_PROCESS'. This should do the trick

rsoika commented 5 years ago

Please note: You should NOT manage your UserIDs and Passwords with the Imixs DocumentService. If you want to store user credentials you should use a separate data table.

lodhipra commented 5 years ago

Sorry to respond you late , I mean copy by using mysqldump command to take imixs DB dump which is working fine and recovery of that dump in another machine. I can see team in drop down menu in submain.xhtml page but can not see team detail in team list.XHTML page

Pooja-gupta1996 commented 5 years ago

@rsoika "i have an issue related setQuery" i am fetching all the details from type column somthing as (type:\type_name) we want to fatch all type row whose status is 'open' which is saved in CURRENT_STATUS_NAME(this is a virtual column in in data) and it have many values as OPEN, CLOSE, ASSIGN and so on. we wantthe the query as mentioned which filters data and produce a list in dataTable like you have done in subtaskList.xhtml where you have all status rows, just filter it and give me the list of only open status value please help us out Thankyou

rsoika commented 5 years ago

@Pooja-gupta1995 I understand that you have a custom item on your documents named 'CURRENT_STATUS_NAME'. And you want to select all entries with for example

CURRENT_STATUS_NAME=OPEN

In this case you first need to add your custom item-name into the search index. Take a look into the file imixs.properties in your project. There you need to add you custom field name to the line with the property ''lucence.indexFieldListNoAnalyze". After a redeployment lucne will take care of your new indexfield. Only item names added to this property will become searchable. For example:

(type:"type_name") AND (current_status_name:"OPEN")

Note: in a search query the item name is always lower cased! And the index of existing document is not automatically updated! So you need to save your document once again.

rsoika commented 5 years ago

@lodhipr If you restore a database from a MySQL Dump than your Lucene index is not automatically updated. This is the reason why you do not find all documents in your index.

To rebuild the index, you can

  1. remove the existing /lucene directory on your application server
  2. redeploy your application.

Imixs-Workflow will recognize the missing lucene index and automatically starts re-indexing. You can see corresponding log messages in your server log. (I already explained this 3 days before)

Pooja-gupta1996 commented 5 years ago

@rsoika : sir you have replied for imixs enterprise edition , can you please describe it what services you will provide yo us and what are the charges , can you please define it clearly

rsoika commented 5 years ago

@Pooja-gupta1995 : can you please fill out our contact form, so I can e-mail you directly.

https://www.imixs.com/contact/