Autosar - pdur - module responsible to trigger event type pdu - serial-port

Can someone explain which module is responsible to trigger event type pdu?

users of PDUR e.g., COM, DCM, BSWM which in turn can trigger based on application triggers e.g., related PDU's COM signal or signal group is triggered by Application through data mapping interface to COM.

Related

How to correctly send custom message to server after some event in OMNET++

I have a problem with the message, which I send from my custom TCP client app service to the server (also with my custom app layer service) in OMNET++ simulation.
My TCPCustomClientApp service is created from TCPBasicCientApp service from INET framework. I overrode some methods like initialize, handleMessage, socketEstablished and I added some helper methods for my needs.
I have my custom message, now, after some trigger from a network, I would like to send this message to the server encapsulated to GenericAppMsg.
this is my code:
...
if (trigger){
connect(); // connect to the server - 3way TCP handshake
auto customMsg = new MyCustomMessage();
customMsg->set ...
msgBuffer.push_back(customMsg); // list with messages
}
then in method socketEstablished(int connId, void *ptr) I have this code for sending:
auto msg = new GenericAppMsg();
msg->setByteLength(requestLength);
msg->setExpectedReplyLength(replyLength);
msg->setServerClose(false);
msg->setKind(1); // set message kind to 1 = TCP_I_DATA (definned in enum TcpStatusInd in TCPCommand.msg)
msg->encapsulate(msgBuffer.front()); // encapsulate my custom message into GenericAppMsg
sendPacket(msg);
The problem is, that when this message comes to the server kind is 3 = ESTABLISHED.
What am I missing? Is this sending wrong?
The kind field is a freely usable field in messages that can be used for anything, but you should be aware that there is absolutely no guarantee that you will get the same value for the kind field on the receiving side. This is considered meta data that is bound to the actual message object. Downwards in the various lower OSI layers the packet can be aggregated or fragmented so the identity of the message object is not kept.
In short, exchanging data in the kind field is safe only if it is used for the communication between two modules that are directly connected. If there is anything between them, you cannot be sure whether the message is forwarded, or recreated with the same content or that some modules on the path between them decides to use the kind field to something else.
Anything that you want to pass to the other end must be encapsulated inside the message.

Is there a way to abort a ScheduledActivity of a SchedulableState?

I would like to know if it is possible to cancel an execution of an ScheduledActivity.
Example:
A SchedulableState of type A is created, and the scheduledActivity will execute a flow that creates another SchedulableState of type A. It means that the app will always execute the flow determined in the activity and create another state of type A.
How can I abort the execution of the activity?
How can I identify if is there a ScheduledActivity waiting to be executed?
As of Corda 4.x, there is no API to cancel scheduled activities.
Instead, you'd have to connect to the node's database directly and drop the required rows from the node's NODE_SCHEDULED_STATES table.

How to get the user who initiated the process in IBM BPM 8.5?

How to get the user who initiated the process in IBM BPM 8.5. I want to reassign my task to the user who actually initiated the process. How it can be achieved in IBM BPM?
There are several ways to get that who initiated a Task , But who initiated a process Instance is somewhat different.
You can perform one out of the following :
Add a private variable and assign it tw.system.user_loginName at the POST of start. you can access that variable for user who initiated the process.(It will be null or undefined for the scenario if task is initiated by some REST API or UCA.)
Place a Tracking group after Start event . Add a input variable to it as username , assign it a value same as tw.system.user_loginName. So whenever Process is started entry will be inserted to DB Table.You can retrieve this value from that view in PerformanceDB.
Also there might be some table ,logging the process Instances details , where you can find the user_id directly.
I suggest you to look in getStarter() method of ProcessInstanceData API.
Official Documentation on API
This link on IBM Developerworks should help you too: Process Starter
Unfortunately there's not an Out Of The Box way to do this - nothing is recorded in the Process Instance that indicates "who" started a process. I presume this is because there are many ways to launch a process instance - from the Portal, via a Message Event, from an API call, etc.
Perhaps the best way to handle this is to add a required Input parameter to your BPD, and supply "who" started the process when you launch it. Unfortunately you can't supply any inputs from the OOTB Portal "New", but you can easilty build your own "launcher".
If you want to route the first task in process to the user that started the process the easiest approach is to simply put the start point in the lane, and on the activity select routing to "Last User In Lane". This will take care of the use case for you without requiring that you do the book keeping to track the user.
Its been a while since I've implemented this, so I can't remember if it will work elegantly if you have system steps before the first task, but this can easily be handled by moving the system steps into the human service to be executed as part of that call, rather than as a separate step in the BPD.
Define variable as string type and using script task to define the login user that use this task and assign it to your defined variable to keep to you in all of the process as initiator of the task.
You can use this line of code to achieve the same:
tw.system.user_loginName

Listening to notification after creation of instance in Openstack

Am interested in finding out if there is a way to create a listener within openstack which gets notified every time a new instance gets created.
Try to take a look at OpenStack workload measuring project https://launchpad.net/ceilometer
One way to do this is by using Django signals. So, you can create a signal and send it after the line of code which creates an instance. The function which expects the notification can be made the receiver which listens to this signal. The function will wait till it receives the signal.As an example:
#Declaring a signal
from django.dispatch import Signal
instance_signal = Signal(providing_args=['param1', 'param2'])
#function that sends the signal
def instance_create():
--code that creates the instance
instance_signal.send(sender='instance_create', param1='I am param 1', param2='I am param 2')
#Defining the function that listens to this signal(the receiver)
def notify_me(**kwargs):
x, y= kwargs['param1'], kwargs['param2']
#Connect the signal to the receiver (Can be written anywhere in the code)
instance_signal.connect(notify_me)
The best part about Django Signals is that you can create the signal, the receiver function and connect them anywhere in the whole application. Django Signals are very useful in scheduling tasks or in your case, receiving notifications.

wf - passing an approval value to an activity

I have an Activity( waiting for an approval ) that contains a WhileActivity. In the while activity I want to read the value of an argument - if it returns true I execute I continue with workflow execution, otherwise I stop the hanging the executing till the argument value turns true
How can I do this - for a while or other activities - ?
Thank you
If the value you are waiting on is being changed by another activity you can use a TrackingParticipant to watch for the value changing and when that happens resume a bookmark to notify your waiting activity.
Sounds more like your requirements would be better served by a State Machine workflow.
Okay, so you don't want to use a State Machine workflow. So, here's how you do it.
You have to create a custom Activity that is used in conjunction with a Workflow Extension. An Extension is just an object that can be accessed by your Activities as the workflow executes and allows your Activities to communicate with the classes that are executing the workflow.
Your custom Activity must be able to create a Bookmark and offload the Workflow. It does this while you wait for the correct value from your Extension. You don't need to do this in any While Activity loop. You just do the following
Get your Extension
Get the current value you are evaluating on
If you aren't happy, create a bookmark
When the bookmark resumes, go to step 1.
If you are happy, continue execution.

Resources