Issue while getting current logged in user id

Hi All,

On swimlane actor filter script in bonita 6 , I am trying to retrive current logged in user but i am not able to reterive. can anybody please let me know how i can acheive this ?

I tried  this code but it didn't worked :-  BonitaUsers.getUser(apiAccessor, loggedUserId).getUserName();

Thanks

Akhilesh

 

 

It throws an exception with message “loggedUserId” is not defined.

Hi,
At the lane level, you can retrieve the user who initiates the processs.
To do that you can use the method: BonitaUsers.getProcessInstanceInitiator (apiAccessor, processInstanceId) .
You can use the loggedUserId variable, only when you want to create a groovy script on a form.


Karim

Thanks Karim for you quick response. I will try this out.

Hi Karim,

First of all thanks for your response.

At task level,

  1. Goto Actor.
  2. Select Actor Filter.
  3. Click on Set and select single user.
  4. On next step give some name and go to next step.
  5. On this step click on edit link.
  6. On the screen select script.
  7. Now at this point I want logged in user so that I can restrict and allow access on that task to user based on logged in user id.

So can you please let me know how can we achieve this ?

Thanks
Akhilesh

Hi Akhilesh,
In the task level you can’t access to the loggedUserId.
You can access to such information, only in the form level (when you want create a script in a widget of your form).

Karim

Hi Akhilesh,
To implement a such use case, you need to model a process like this:
https://farm3.staticflickr.com/2874/13581210643_f2bdc481a5_m.jpg
You need also to create a process boolean variable. This variable is used to create condition after the XOR gateway.

Hope it helps

Karim

Hi,
1-One of the goals of using sub-processes is reuse. So you will use the same sub-process, and you re-implement only the call activity in task B,C…
2-In the studio you can’t use mysql. We use only H2 database. Mysql is used only when you want to setup a bonita server (production environment for example).

Karim

Hi Akhilesh,
Can you explain what do you mean by didn’t work: It is a compilation problem? an execution problem?
Have you an exception in the engine logs?

Karim

Hi Karim,

Thanks for your response.
Use Case

  1. We have a Manager who is having list of all the Servers that needs to restored.
  2. He is having list of all the technician who are going to perform this task.
  3. There are 4 steps in which this restoration happens, say A,B,C,D.
  4. Now let suppose manager has List of 3 server which he wants to restore.
  5. He comes into the system and assigns all the 3 Servers to the 3 technicians.
  6. Now each technician has to perform same set of task. And manager wants to keep track of each task.
  7. And in between on any task if any issue occurs then he has to raise incident.
  8. And once the incident is resolved he has to go back to the same task and mark it complete and continue to the next step.

My Implementation

  1. I have created multi-instance task by which i have created say 3 different task instance one for each user.

Question

  1. In regards to point no 7 and 8 I have a question.
    If user founds any issue then he has to log incidence, for this I have created a sub process.
    So from Task A he clicks on create incidence button(Submit Button) and he is routed to sub process of incident management.
    But when he clicks on create incidence button Task A will be completed then how can we route him back to the same task once he resolves incidence ticket ?
    Is their way to submit a task without completing it ?
    how to get the task ID ?

Thanks
Akhilesh

Hi Karim,

Once again thanks for your quick response.
Point 1.
As per image If there is any issue on Task 1 then it will call sub process and once sub-process is completed it will come back to task 1 .
But for the task 2 , task 3 we have to implement the same behaviour .
Then in that case do we need to duplicate the call activity for task 2 and task 3 or from one call activity we can achieve this ?

Point 2
Sorry I am asking too many questions to you. But please bare with this beginner in Bonita.

Can I configure Bonita Studio 6.2 with My Sql ? Actually I have made changes on below files for mysql
a. \BonitaBPMSubscription-6.2.2\workspace\server_configuration\tomcat_conf\Catalina\localhost\bonita.xml
b. \BonitaBPMSubscription-6.2.2\workspace\server_configuration\tomcat_conf\server.xml
c. \BonitaBPMSubscription-6.2.2\workspace\server_configuration\tomcat_conf\bitronix-resources.properties
d. \BonitaBPMSubscription-6.2.2\workspace\tomcat\bin\setenv.bat

But when i have restarted the bonita studio 6.2 it replaces file the with orginal values.
So If it is possible then am I missing anything ?

Thanks
Akhilesh

Thanks for your response.

  1. Let suppose I have a form with three textboxes when we submit that form , does it’s data gets stored somewhere in DB or we need to add a connector to save it in some table ?
  2. Can we create a table in H2 DB to store some data from form ?

Thanks
Akhilesh

Hi Karim,

Can you please answer to my by below questions

  1. Let suppose I have a form with three textboxes when we submit that form , does it’s data gets stored somewhere in DB or we need to add a connector to save it in some table ?
  2. Can we create a table in H2 DB to store some data from form ?

Thanks
Akhilesh

Hi,
by default, data are stored in in H2 database.
If you want to store data in business database, you must create connectors on your task
Karim

Thanks
Akhilesh

Hi Karim,

How can we get list of all the task which are assigned but not taken by any user ?
Basically how can we get task with different states ?

Thanks
Akhilesh

Hi Karim

I want to read an excel file of version 2007/2010 (.xls or .xlsx). After reading I want to insert that data into mysql. How can I achieve this ? Can you please help …

Thanks
Akhilesh

Hi Karim,

Can you please take look at below use case and reply, I am stuck with this issue.

Use case.
Step 1. I have created three different groups grp1(user 1,user 2) ,grp2(user 21,user 22),grp3(user 31,user 32).
Step 2. Now I have created a task say “task 1” and its is assigned to a user of grp1 say “user 1”.
Step 3. Now if the “task 1” is not completed within given time it needs to be escalated to grp2 or grp3.
Step 4. To achieve step 3, I have added interuppting timer to “task 1” and from timer I have added task in the next lane say “lane1”
Step 5. In lane1 I have defined a actor and added grp2 and grp3 to that actor.
Step 6. Now the problem is, on lane1 I want to assign the task to either grp1 or grp2.
So how can we dynamically assign the task to a given group.
On actor filter i have seen provision to add single user, task performer and user manager.
But I don’t see any option to assign dynamic group , so can you please me with this problem ?

Thanks in advance
Akhilesh